MCPcopy
hub / github.com/pytest-dev/pytest / test_imperativeskip_on_xfail_test

Function test_imperativeskip_on_xfail_test

testing/test_skipping.py:1209–1236  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1207
1208
1209def test_imperativeskip_on_xfail_test(pytester: Pytester) -> None:
1210 pytester.makepyfile(
1211 """
1212 import pytest
1213 @pytest.mark.xfail
1214 def test_that_fails():
1215 assert 0
1216
1217 @pytest.mark.skipif("True")
1218 def test_hello():
1219 pass
1220 """
1221 )
1222 pytester.makeconftest(
1223 """
1224 import pytest
1225 def pytest_runtest_setup(item):
1226 pytest.skip("abc")
1227 """
1228 )
1229 result = pytester.runpytest("-rsxX")
1230 result.stdout.fnmatch_lines_random(
1231 """
1232 *SKIP*abc*
1233 *SKIP*condition: True*
1234 *2 skipped*
1235 """
1236 )
1237
1238
1239class TestBooleanCondition:

Callers

nothing calls this directly

Calls 4

fnmatch_lines_randomMethod · 0.80
makepyfileMethod · 0.45
makeconftestMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected