CollectReport.longreprtext can handle non-str ``longrepr`` attributes (#7559)
(self, pytester: Pytester)
| 969 | assert "Skipped" in call_rep.longreprtext |
| 970 | |
| 971 | def test_longreprtext_collect_skip(self, pytester: Pytester) -> None: |
| 972 | """CollectReport.longreprtext can handle non-str ``longrepr`` attributes (#7559)""" |
| 973 | pytester.makepyfile( |
| 974 | """ |
| 975 | import pytest |
| 976 | pytest.skip(allow_module_level=True) |
| 977 | """ |
| 978 | ) |
| 979 | rec = pytester.inline_run() |
| 980 | calls = rec.getcalls("pytest_collectreport") |
| 981 | _, call = calls |
| 982 | assert isinstance(call.report.longrepr, tuple) |
| 983 | assert "Skipped" in call.report.longreprtext |
| 984 | |
| 985 | def test_longreprtext_failure(self, pytester: Pytester) -> None: |
| 986 | reports = pytester.runitem( |
nothing calls this directly
no test coverage detected