(cls: type[_T], *k, **kw)
| 97 | fail(msg, pytrace=False) |
| 98 | |
| 99 | def _create(cls: type[_T], *k, **kw) -> _T: |
| 100 | try: |
| 101 | return super().__call__(*k, **kw) # type: ignore[no-any-return,misc] |
| 102 | except TypeError: |
| 103 | sig = signature(getattr(cls, "__init__")) |
| 104 | known_kw = {k: v for k, v in kw.items() if k in sig.parameters} |
| 105 | from .warning_types import PytestDeprecationWarning |
| 106 | |
| 107 | warnings.warn( |
| 108 | PytestDeprecationWarning( |
| 109 | f"{cls} is not using a cooperative constructor and only takes {set(known_kw)}.\n" |
| 110 | "See https://docs.pytest.org/en/stable/deprecations.html" |
| 111 | "#constructors-of-custom-pytest-node-subclasses-should-take-kwargs " |
| 112 | "for more details." |
| 113 | ) |
| 114 | ) |
| 115 | |
| 116 | return super().__call__(*k, **known_kw) # type: ignore[no-any-return,misc] |
| 117 | |
| 118 | |
| 119 | class Node(abc.ABC, metaclass=NodeMeta): |
no test coverage detected