(self, pytester: Pytester)
| 1008 | assert not excinfo.traceback[-2].ishidden() |
| 1009 | |
| 1010 | def test_traceback_argsetup(self, pytester: Pytester) -> None: |
| 1011 | pytester.makeconftest( |
| 1012 | """ |
| 1013 | import pytest |
| 1014 | |
| 1015 | @pytest.fixture |
| 1016 | def hello(request): |
| 1017 | raise ValueError("xyz") |
| 1018 | """ |
| 1019 | ) |
| 1020 | p = pytester.makepyfile("def test(hello): pass") |
| 1021 | result = pytester.runpytest(p) |
| 1022 | assert result.ret != 0 |
| 1023 | out = result.stdout.str() |
| 1024 | assert "xyz" in out |
| 1025 | assert "conftest.py:5: ValueError" in out |
| 1026 | numentries = out.count("_ _ _") # separator for traceback entries |
| 1027 | assert numentries == 0 |
| 1028 | |
| 1029 | result = pytester.runpytest("--fulltrace", p) |
| 1030 | out = result.stdout.str() |
| 1031 | assert "conftest.py:5: ValueError" in out |
| 1032 | numentries = out.count("_ _ _ _") # separator for traceback entries |
| 1033 | assert numentries > 3 |
| 1034 | |
| 1035 | def test_traceback_error_during_import(self, pytester: Pytester) -> None: |
| 1036 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected