(self, pytester: Pytester)
| 286 | # assert rep.longrepr.reprtraceback.reprentries |
| 287 | |
| 288 | def test_custom_failure_repr(self, pytester: Pytester) -> None: |
| 289 | pytester.makepyfile( |
| 290 | conftest=""" |
| 291 | import pytest |
| 292 | class Function(pytest.Function): |
| 293 | def repr_failure(self, excinfo): |
| 294 | return "hello" |
| 295 | """ |
| 296 | ) |
| 297 | reports = pytester.runitem( |
| 298 | """ |
| 299 | import pytest |
| 300 | def test_func(): |
| 301 | assert 0 |
| 302 | """ |
| 303 | ) |
| 304 | rep = reports[1] |
| 305 | assert not rep.skipped |
| 306 | assert not rep.passed |
| 307 | assert rep.failed |
| 308 | # assert rep.outcome.when == "call" |
| 309 | # assert rep.failed.where.lineno == 3 |
| 310 | # assert rep.failed.where.path.basename == "test_func.py" |
| 311 | # assert rep.failed.failurerepr == "hello" |
| 312 | |
| 313 | def test_teardown_final_returncode(self, pytester: Pytester) -> None: |
| 314 | rec = pytester.inline_runsource( |
nothing calls this directly
no test coverage detected