Skip to content

Commit

Permalink
Node._repr_failure_py: use abspath with changed cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed authored and nicoddemus committed May 30, 2020
1 parent 56bf819 commit fb9f277
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/_pytest/nodes.py
Expand Up @@ -362,8 +362,7 @@ def _repr_failure_py(
truncate_locals = True

try:
os.getcwd()
abspath = False
abspath = os.getcwd() != str(self.config.invocation_dir)
except OSError:
abspath = True

Expand Down

0 comments on commit fb9f277

Please sign in to comment.