I'm using Pytest 7.0.1on Ubuntu 18.04 with Python 3.6.9.
Consider a test:
def test_0(bar):
assert 0
and a fixture defined in conftest.py that will skip a test based on some conditional check.
import pytest
@pytest.fixture
def bar():
if some_condition:
pytest.skip("Skipping")
Then running the test with pytest shows something like:
$ pytest . -rs
================================== test session starts ==================================
platform linux -- Python 3.6.9, pytest-7.0.1, pluggy-1.0.0
rootdir: /tmp/foo
plugins: cpp-2.1.2
collected 1 item
test_foo.py s [100%]
================================ short test summary info ================================
SKIPPED [1] conftest.py:6: Skipping
================================== 1 skipped in 0.01s ===================================
The summary shows that some test was skipped but there's no indication which test was skipped. Instead, it should show the test name rather than the location in the fixture where the pytest.skip was called from. If there are multiple tests that are skipped from various locations, matching a test with its skip condition becomes impossible.
There are some similar issues in #114, #748, #760 which may be related.
I'm using Pytest 7.0.1on Ubuntu 18.04 with Python 3.6.9.
Consider a test:
and a fixture defined in
conftest.pythat will skip a test based on some conditional check.Then running the test with pytest shows something like:
The summary shows that some test was skipped but there's no indication which test was skipped. Instead, it should show the test name rather than the location in the fixture where the
pytest.skipwas called from. If there are multiple tests that are skipped from various locations, matching a test with its skip condition becomes impossible.There are some similar issues in #114, #748, #760 which may be related.