(pytester: Pytester)
| 115 | |
| 116 | @pytest.mark.filterwarnings("error::pytest.PytestUnraisableExceptionWarning") |
| 117 | def 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} |
nothing calls this directly
no test coverage detected