Added Docstring description for the Path property of the FixtureRequest class.

This commit is contained in:
Paul Reece 2022-06-17 11:52:18 -04:00
parent fab696dcd1
commit 5a9536cf42
1 changed files with 1 additions and 0 deletions

View File

@ -486,6 +486,7 @@ class FixtureRequest:
@property
def path(self) -> Path:
"""Path where the test function was collected."""
if self.scope not in ("function", "class", "module", "package"):
raise AttributeError(f"path not available in {self.scope}-scoped context")
# TODO: Remove ignore once _pyfuncitem is properly typed.