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