Merge pull request #6488 from blueyed/typing-fix-reportinfo
typing: Node.reportinfo: might return py.path.local via fspath
This commit is contained in:
commit
e211d6fe2a
|
@ -424,7 +424,7 @@ class FixtureRequest:
|
||||||
return self._pyfuncitem.getparent(_pytest.python.Module).obj
|
return self._pyfuncitem.getparent(_pytest.python.Module).obj
|
||||||
|
|
||||||
@scopeproperty()
|
@scopeproperty()
|
||||||
def fspath(self):
|
def fspath(self) -> py.path.local:
|
||||||
""" the file system path of the test module which collected this test. """
|
""" the file system path of the test module which collected this test. """
|
||||||
return self._pyfuncitem.fspath
|
return self._pyfuncitem.fspath
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ class Item(Node):
|
||||||
if content:
|
if content:
|
||||||
self._report_sections.append((when, key, 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, ""
|
return self.fspath, None, ""
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
|
|
@ -114,7 +114,7 @@ class BaseReport:
|
||||||
skipped = property(lambda x: x.outcome == "skipped")
|
skipped = property(lambda x: x.outcome == "skipped")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fspath(self):
|
def fspath(self) -> str:
|
||||||
return self.nodeid.split("::")[0]
|
return self.nodeid.split("::")[0]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue