(pytester: Pytester, capfd)
| 1224 | |
| 1225 | |
| 1226 | def test_notify_exception(pytester: Pytester, capfd) -> None: |
| 1227 | config = pytester.parseconfig() |
| 1228 | with pytest.raises(ValueError) as excinfo: |
| 1229 | raise ValueError(1) |
| 1230 | config.notify_exception(excinfo, config.option) |
| 1231 | _, err = capfd.readouterr() |
| 1232 | assert "ValueError" in err |
| 1233 | |
| 1234 | class A: |
| 1235 | def pytest_internalerror(self): |
| 1236 | return True |
| 1237 | |
| 1238 | config.pluginmanager.register(A()) |
| 1239 | config.notify_exception(excinfo, config.option) |
| 1240 | _, err = capfd.readouterr() |
| 1241 | assert not err |
| 1242 | |
| 1243 | config = pytester.parseconfig("-p", "no:terminal") |
| 1244 | with pytest.raises(ValueError) as excinfo: |
| 1245 | raise ValueError(1) |
| 1246 | config.notify_exception(excinfo, config.option) |
| 1247 | _, err = capfd.readouterr() |
| 1248 | assert "ValueError" in err |
| 1249 | |
| 1250 | |
| 1251 | def test_no_terminal_discovery_error(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected