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 16, 2020
1 parent f506682 commit e93e28a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/_pytest/nodes.py
Expand Up @@ -360,8 +360,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 e93e28a

Please sign in to comment.