Merge pull request #10083 from pytest-dev/backport-10078-to-7.1.x
This commit is contained in:
1
changelog/9791.bugfix.rst
Normal file
1
changelog/9791.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
||||
Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems.
|
||||
@@ -190,7 +190,7 @@ class AssertionRewritingHook(importlib.abc.MetaPathFinder, importlib.abc.Loader)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user