Python module object where the test function was collected.
(self)
| 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: |