summaryrefslogtreecommitdiff
path: root/src/_pytest/nodes.py
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2020-08-06 14:46:24 +0300
committerRan Benita <ran@unusedvar.com>2020-09-04 18:05:42 +0300
commit62e249a1f934d1073c9a0167077e133c5e0f6270 (patch)
tree9ec91bff8624c5ff9adbf07b8ec873c7a1c08b32 /src/_pytest/nodes.py
parenta346028006a7ca9d07788e837456b3ab3a1209eb (diff)
downloadpytest-62e249a1f934d1073c9a0167077e133c5e0f6270.tar.gz
Replace some usages of config.{rootdir,inifile} with config.{rootpath,inipath}
Diffstat (limited to 'src/_pytest/nodes.py')
-rw-r--r--src/_pytest/nodes.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py
index 5dde4c737..3665d8d5e 100644
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ -31,6 +31,7 @@ from _pytest.mark.structures import Mark
from _pytest.mark.structures import MarkDecorator
from _pytest.mark.structures import NodeKeywords
from _pytest.outcomes import fail
+from _pytest.pathlib import absolutepath
from _pytest.pathlib import Path
from _pytest.store import Store
@@ -401,7 +402,7 @@ class Node(metaclass=NodeMeta):
# It will be better to just always display paths relative to invocation_dir, but
# this requires a lot of plumbing (#6428).
try:
- abspath = Path(os.getcwd()) != Path(str(self.config.invocation_dir))
+ abspath = Path(os.getcwd()) != self.config.invocation_params.dir
except OSError:
abspath = True
@@ -597,10 +598,7 @@ class Item(Node):
@cached_property
def location(self) -> Tuple[str, Optional[int], str]:
location = self.reportinfo()
- if isinstance(location[0], py.path.local):
- fspath = location[0]
- else:
- fspath = py.path.local(location[0])
+ fspath = absolutepath(str(location[0]))
relfspath = self.session._node_location_to_relpath(fspath)
assert type(location[2]) is str
return (relfspath, location[1], location[2])