Skip to content

Commit

Permalink
Merge pull request pytest-dev#10078 from nicoddemus/pathsep-9791
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Jun 27, 2022
2 parents 8bbd35a + f92c4a7 commit da9a2b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/9791.bugfix.rst
@@ -0,0 +1 @@
Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems.
2 changes: 1 addition & 1 deletion src/_pytest/assertion/rewrite.py
Expand Up @@ -190,7 +190,7 @@ def _early_rewrite_bailout(self, name: str, state: "AssertionState") -> bool:
return False

# For matching the name it must be as if it was a filename.
path = PurePath(os.path.sep.join(parts) + ".py")
path = PurePath(*parts).with_suffix(".py")

for pat in self.fnpats:
# if the pattern contains subdirectories ("tests/**.py" for example) we can't bail out based
Expand Down

0 comments on commit da9a2b5

Please sign in to comment.