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

Function test_fail_using_reason_works_ok

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

Source from the content-addressed store, hash-verified

1459
1460
1461def test_fail_using_reason_works_ok(pytester: Pytester) -> None:
1462 p = pytester.makepyfile(
1463 """
1464 import pytest
1465
1466 def test_failing_reason():
1467 pytest.fail(reason="failedreason")
1468 """
1469 )
1470 result = pytester.runpytest(p)
1471 result.stdout.no_fnmatch_line("*PytestDeprecationWarning*")
1472 result.assert_outcomes(failed=1)
1473
1474
1475def test_fail_fails_with_msg_and_reason(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

no_fnmatch_lineMethod · 0.80
assert_outcomesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected