Skip to content

skipping: --runxfail breaks pytest.mark.skip location reporting #7392

@bluetech

Description

@bluetech

pytest versions: 5.4.x, current master

When @pytest.mark.skip/skipif marks are used to skip a test, for example

import pytest
@pytest.mark.skip
def test_skip_location() -> None:
    assert 0

the expected skip location reported should point to the item itself, and this is indeed what happens when running with pytest -rs:

SKIPPED [1] test_it.py:3: unconditional skip

However, adding pytest -rs --runxfail breaks this:

SKIPPED [1] src/_pytest/skipping.py:238: unconditional skip

The --runxfail is only about xfail and should not affect this at all.


Hint: the bug is in src/_pytest/skipping.py, the pytest_runtest_makereport hook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortopic: marksrelated to marks, either the general marks or builtintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions