MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_xfail_test_setup_exception

Function test_xfail_test_setup_exception

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

Source from the content-addressed store, hash-verified

1199
1200
1201def test_xfail_test_setup_exception(pytester: Pytester) -> None:
1202 pytester.makeconftest(
1203 """
1204 def pytest_runtest_setup():
1205 0 / 0
1206 """
1207 )
1208 p = pytester.makepyfile(
1209 """
1210 import pytest
1211 @pytest.mark.xfail
1212 def test_func():
1213 assert 0
1214 """
1215 )
1216 result = pytester.runpytest(p)
1217 assert result.ret == 0
1218 assert "xfailed" in result.stdout.str()
1219 result.stdout.no_fnmatch_line("*xpassed*")
1220
1221
1222def test_imperativeskip_on_xfail_test(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 5

strMethod · 0.80
no_fnmatch_lineMethod · 0.80
makeconftestMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected