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

Method __init__

src/_pytest/fixtures.py:765–787  ·  view source on GitHub ↗
(
        self,
        request: "FixtureRequest",
        scope: Scope,
        param: Any,
        param_index: int,
        fixturedef: "FixtureDef[object]",
        *,
        _ispytest: bool = False,
    )

Source from the content-addressed store, hash-verified

763 """A sub request for handling getting a fixture from a test function/fixture."""
764
765 def __init__(
766 self,
767 request: "FixtureRequest",
768 scope: Scope,
769 param: Any,
770 param_index: int,
771 fixturedef: "FixtureDef[object]",
772 *,
773 _ispytest: bool = False,
774 ) -> None:
775 check_ispytest(_ispytest)
776 self._parent_request = request
777 self.fixturename = fixturedef.argname
778 if param is not NOTSET:
779 self.param = param
780 self.param_index = param_index
781 self._scope = scope
782 self._fixturedef = fixturedef
783 self._pyfuncitem = request._pyfuncitem
784 self._fixture_defs = request._fixture_defs
785 self._arg2fixturedefs = request._arg2fixturedefs
786 self._arg2index = request._arg2index
787 self._fixturemanager = request._fixturemanager
788
789 def __repr__(self) -> str:
790 return f"<SubRequest {self.fixturename!r} for {self._pyfuncitem!r}>"

Callers

nothing calls this directly

Calls 1

check_ispytestFunction · 0.90

Tested by

no test coverage detected