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

Function test_unraisable_warning_error

testing/test_unraisableexception.py:117–133  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

115
116@pytest.mark.filterwarnings("error::pytest.PytestUnraisableExceptionWarning")
117def test_unraisable_warning_error(pytester: Pytester) -> None:
118 pytester.makepyfile(
119 test_it="""
120 class BrokenDel:
121 def __del__(self) -> None:
122 raise ValueError("del is broken")
123
124 def test_it() -> None:
125 obj = BrokenDel()
126 del obj
127
128 def test_2(): pass
129 """
130 )
131 result = pytester.runpytest()
132 assert result.ret == pytest.ExitCode.TESTS_FAILED
133 assert result.parseoutcomes() == {"passed": 1, "failed": 1}

Callers

nothing calls this directly

Calls 3

parseoutcomesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected