summaryrefslogtreecommitdiff
path: root/src/_pytest/nodes.py
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2020-01-10 00:50:12 +0100
committerBruno Oliveira <nicoddemus@gmail.com>2020-05-30 20:02:47 -0300
commitfb9f277a99c32dbdde251a1df1ae5bc64c4c7de6 (patch)
tree3614fc79f75b60bc65005a3efea3734d72f84ead /src/_pytest/nodes.py
parent56bf819c2f4eaf8b36bd8c42c06bb59d5a3bfc0f (diff)
downloadpytest-fb9f277a99c32dbdde251a1df1ae5bc64c4c7de6.tar.gz
Node._repr_failure_py: use abspath with changed cwd
Fixes https://github.com/pytest-dev/pytest/issues/6428.
Diffstat (limited to 'src/_pytest/nodes.py')
-rw-r--r--src/_pytest/nodes.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py
index 4a79bc861..61c6bc90a 100644
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ -362,8 +362,7 @@ class Node(metaclass=NodeMeta):
truncate_locals = True
try:
- os.getcwd()
- abspath = False
+ abspath = os.getcwd() != str(self.config.invocation_dir)
except OSError:
abspath = True