MCPcopy
hub / github.com/pytest-dev/pytest / test_itemreport_reportinfo

Method test_itemreport_reportinfo

testing/python/collect.py:1254–1268  ·  testing/python/collect.py::TestReportInfo.test_itemreport_reportinfo
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

1252
1253class TestReportInfo:
1254 def test_itemreport_reportinfo(self, pytester: Pytester) -> None:
1255 pytester.makeconftest(
1256 class="st">"""
1257 import pytest
1258 class MyFunction(pytest.Function):
1259 def reportinfo(self):
1260 return class="st">"ABCDE", 42, class="st">"custom"
1261 def pytest_pycollect_makeitem(collector, name, obj):
1262 if name == class="st">"test_func":
1263 return MyFunction.from_parent(name=name, parent=collector)
1264 class="st">"""
1265 )
1266 item = pytester.getitem(class="st">"def test_func(): pass")
1267 item.config.pluginmanager.getplugin(class="st">"runner")
1268 assert item.location == (class="st">"ABCDE", 42, class="st">"custom")
1269
1270 def test_func_reportinfo(self, pytester: Pytester) -> None:
1271 item = pytester.getitem(class="st">"def test_func(): pass")

Callers

nothing calls this directly

Calls 3

getpluginMethod · 0.80
makeconftestMethod · 0.45
getitemMethod · 0.45

Tested by

no test coverage detected