(pytester: Pytester, capfd)
| 1812 | |
| 1813 | |
| 1814 | def test_notify_exception(pytester: Pytester, capfd) -> None: |
| 1815 | config = pytester.parseconfig() |
| 1816 | with pytest.raises(ValueError) as excinfo: |
| 1817 | raise ValueError(1) |
| 1818 | config.notify_exception(excinfo, config.option) |
| 1819 | _, err = capfd.readouterr() |
| 1820 | assert "ValueError" in err |
| 1821 | |
| 1822 | class A: |
| 1823 | def pytest_internalerror(self): |
| 1824 | return True |
| 1825 | |
| 1826 | config.pluginmanager.register(A()) |
| 1827 | config.notify_exception(excinfo, config.option) |
| 1828 | _, err = capfd.readouterr() |
| 1829 | assert not err |
| 1830 | |
| 1831 | config = pytester.parseconfig("-p", "no:terminal") |
| 1832 | with pytest.raises(ValueError) as excinfo: |
| 1833 | raise ValueError(1) |
| 1834 | config.notify_exception(excinfo, config.option) |
| 1835 | _, err = capfd.readouterr() |
| 1836 | assert "ValueError" in err |
| 1837 | |
| 1838 | |
| 1839 | def test_no_terminal_discovery_error(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected