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

Function test_outcome_exception_bad_msg

testing/test_runner.py:1049–1061  ·  view source on GitHub ↗

Check that OutcomeExceptions validate their input to prevent confusing errors (#5578)

()

Source from the content-addressed store, hash-verified

1047
1048
1049def test_outcome_exception_bad_msg() -> None:
1050 """Check that OutcomeExceptions validate their input to prevent confusing errors (#5578)"""
1051
1052 def func() -> None:
1053 raise NotImplementedError()
1054
1055 expected = (
1056 "OutcomeException expected string as 'msg' parameter, got 'function' instead.\n"
1057 "Perhaps you meant to use a mark?"
1058 )
1059 with pytest.raises(TypeError) as excinfo:
1060 OutcomeException(func) # type: ignore
1061 assert str(excinfo.value) == expected

Callers

nothing calls this directly

Calls 1

OutcomeExceptionClass · 0.90

Tested by

no test coverage detected