MCPcopy Index your code
hub / github.com/python/mypy / pytest_pycollect_makeitem

Function pytest_pycollect_makeitem

mypy/test/data.py:659–671  ·  view source on GitHub ↗

Called by pytest on each object in modules configured in conftest.py files. collector is pytest.Collector, returns Optional[pytest.Class]

(collector: Any, name: str, obj: object)

Source from the content-addressed store, hash-verified

657# This function name is special to pytest. See
658# https://doc.pytest.org/en/latest/how-to/writing_plugins.html#collection-hooks
659def pytest_pycollect_makeitem(collector: Any, name: str, obj: object) -> Any | None:
660 """Called by pytest on each object in modules configured in conftest.py files.
661
662 collector is pytest.Collector, returns Optional[pytest.Class]
663 """
664 if isinstance(obj, type):
665 # Only classes derived from DataSuite contain test cases, not the DataSuite class itself
666 if issubclass(obj, DataSuite) and obj is not DataSuite:
667 # Non-None result means this obj is a test case.
668 # The collect method of the returned DataSuiteCollector instance will be called later,
669 # with self.obj being obj.
670 return DataSuiteCollector.from_parent(parent=collector, name=name)
671 return None
672
673
674_case_name_pattern = re.compile(

Callers

nothing calls this directly

Calls 2

isinstanceFunction · 0.85
from_parentMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…