MCPcopy
hub / github.com/pytest-dev/pytest / module

Method module

src/_pytest/fixtures.py:543–549  ·  view source on GitHub ↗

Python module object where the test function was collected.

(self)

Source from the content-addressed store, hash-verified

541
542 @property
543 def module(self):
544 """Python module object where the test function was collected."""
545 if self.scope not in ("function", "class", "module"):
546 raise AttributeError(f"module not available in {self.scope}-scoped context")
547 mod = self._pyfuncitem.getparent(_pytest.python.Module)
548 assert mod is not None
549 return mod.obj
550
551 @property
552 def path(self) -> Path:

Callers

nothing calls this directly

Calls 1

getparentMethod · 0.80

Tested by

no test coverage detected