Check that OutcomeExceptions validate their input to prevent confusing errors (#5578)
()
| 1047 | |
| 1048 | |
| 1049 | def 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 |
nothing calls this directly
no test coverage detected