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

Method test_class_reportinfo

testing/python/collect.py:1277–1290  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

1275 assert modpath == "test_func"
1276
1277 def test_class_reportinfo(self, pytester: Pytester) -> None:
1278 modcol = pytester.getmodulecol(
1279 """
1280 # lineno 0
1281 class TestClass(object):
1282 def test_hello(self): pass
1283 """
1284 )
1285 classcol = pytester.collect_by_name(modcol, "TestClass")
1286 assert isinstance(classcol, Class)
1287 path, lineno, msg = classcol.reportinfo()
1288 assert os.fspath(path) == str(modcol.path)
1289 assert lineno == 1
1290 assert msg == "TestClass"
1291
1292 @pytest.mark.filterwarnings(
1293 "ignore:usage of Generator.Function is deprecated, please use pytest.Function instead"

Callers

nothing calls this directly

Calls 4

fspathMethod · 0.80
getmodulecolMethod · 0.45
collect_by_nameMethod · 0.45
reportinfoMethod · 0.45

Tested by

no test coverage detected