Commit 2619ea4
committed
conftest(fix): Filter doctests at collection for control engine
Filter doctests from collection instead of skipping them to avoid
pytest's _use_item_location bug: DoctestItem.reportinfo() returns
None lineno for fixture doctests, which triggers assertion failure
in _pytest/reports.py:420 when skipped via fixtures or markers.
Both pytest.skip() in fixtures and pytest.mark.skip() trigger the
same code path where pytest sets _use_item_location=True, causing
the assertion to fail when it tries to use the item's location.
The workaround removes doctests from the collected items list when
running with --engine=control, avoiding the bug entirely.1 parent 0291044 commit 2619ea4
1 file changed
+18
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 43 | | |
51 | 44 | | |
52 | 45 | | |
| |||
205 | 198 | | |
206 | 199 | | |
207 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
0 commit comments