MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_longreprtext_collect_skip

Method test_longreprtext_collect_skip

testing/test_runner.py:971–983  ·  view source on GitHub ↗

CollectReport.longreprtext can handle non-str ``longrepr`` attributes (#7559)

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 3

getcallsMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected