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

Method _create

src/_pytest/nodes.py:138–155  ·  view source on GitHub ↗
(self, *k, **kw)

Source from the content-addressed store, hash-verified

136 fail(msg, pytrace=False)
137
138 def _create(self, *k, **kw):
139 try:
140 return super().__call__(*k, **kw)
141 except TypeError:
142 sig = signature(getattr(self, "__init__"))
143 known_kw = {k: v for k, v in kw.items() if k in sig.parameters}
144 from .warning_types import PytestDeprecationWarning
145
146 warnings.warn(
147 PytestDeprecationWarning(
148 f"{self} is not using a cooperative constructor and only takes {set(known_kw)}.\n"
149 "See https://docs.pytest.org/en/stable/deprecations.html"
150 "#constructors-of-custom-pytest-node-subclasses-should-take-kwargs "
151 "for more details."
152 )
153 )
154
155 return super().__call__(*k, **known_kw)
156
157
158class Node(metaclass=NodeMeta):

Callers 3

from_parentMethod · 0.80
from_configMethod · 0.80
MetafuncMethod · 0.80

Calls 3

__call__Method · 0.45
warnMethod · 0.45

Tested by

no test coverage detected