Elffuss BraidHub

kikocis/auto-code-rover public

main · 773 BRawPermalink
1skipping: --runxfail breaks pytest.mark.skip location reporting
2pytest versions: 5.4.x, current master
3
4When `@pytest.mark.skip`/`skipif` marks are used to skip a test, for example
5
6```py
7import pytest
8@pytest.mark.skip
9def test_skip_location() -> None:
10 assert 0
11```
12
13the expected skip location reported should point to the item itself, and this is indeed what happens when running with `pytest -rs`:
14
15```
16SKIPPED [1] test_it.py:3: unconditional skip
17```
18
19However, adding `pytest -rs --runxfail` breaks this:
20
21```
22SKIPPED [1] src/_pytest/skipping.py:238: unconditional skip
23```
24
25The `--runxfail` is only about xfail and should not affect this at all.
26
27---
28
29Hint: the bug is in `src/_pytest/skipping.py`, the `pytest_runtest_makereport` hook.