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

Method __init_subclass__

src/_pytest/nodes.py:659–671  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

657 nextitem = None
658
659 def __init_subclass__(cls) -> None:
660 problems = ", ".join(
661 base.__name__ for base in cls.__bases__ if issubclass(base, Collector)
662 )
663 if problems:
664 warnings.warn(
665 f"{cls.__name__} is an Item subclass and should not be a collector, "
666 f"however its bases {problems} are collectors.\n"
667 "Please split the Collectors and the Item into separate node types.\n"
668 "Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html\n"
669 "example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/",
670 PytestWarning,
671 )
672
673 def __init__(
674 self,

Callers

nothing calls this directly

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected