Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def module(self):
return self._pyfuncitem.getparent(_pytest.python.Module).obj

@scopeproperty()
def fspath(self):
def fspath(self) -> py.path.local:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that mypy-diff (#6486) would complain here for this to be missing still (since mypy does not know about py.path.local).

""" the file system path of the test module which collected this test. """
return self._pyfuncitem.fspath

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def add_report_section(self, when: str, key: str, content: str) -> None:
if content:
self._report_sections.append((when, key, content))

def reportinfo(self) -> Tuple[str, Optional[int], str]:
def reportinfo(self) -> Tuple[Union[py.path.local, str], Optional[int], str]:
return self.fspath, None, ""

@cached_property
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def capstderr(self):
skipped = property(lambda x: x.outcome == "skipped")

@property
def fspath(self):
def fspath(self) -> str:
return self.nodeid.split("::")[0]

@property
Expand Down