Node._repr_failure_py: use abspath with changed cwd

Fixes https://github.com/pytest-dev/pytest/issues/6428.
This commit is contained in:
Daniel Hahler 2020-01-10 00:50:12 +01:00 committed by Bruno Oliveira
parent 56bf819c2f
commit fb9f277a99
1 changed files with 1 additions and 2 deletions

View File

@ -362,8 +362,7 @@ class Node(metaclass=NodeMeta):
truncate_locals = True truncate_locals = True
try: try:
os.getcwd() abspath = os.getcwd() != str(self.config.invocation_dir)
abspath = False
except OSError: except OSError:
abspath = True abspath = True