-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix pytest with mixed up filename casing. #5792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Windows: Fix error that occurs in certain circumstances when loading | ||
``conftest.py`` from a working directory that has casing other than the one stored | ||
in the filesystem (e.g., ``c:\test`` instead of ``C:\test``). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
from os.path import expanduser | ||
from os.path import expandvars | ||
from os.path import isabs | ||
from os.path import normcase | ||
from os.path import sep | ||
from posixpath import sep as posix_sep | ||
|
||
|
@@ -334,3 +335,12 @@ def fnmatch_ex(pattern, path): | |
def parts(s): | ||
parts = s.split(sep) | ||
return {sep.join(parts[: i + 1]) or sep for i in range(len(parts))} | ||
|
||
|
||
def unique_path(path): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was it considered to keep this private, i.e. as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was originally private, but given it was on a private module already, I asked @Oberon00 to remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See 29bb0ed |
||
"""Returns a unique path in case-insensitive (but case-preserving) file | ||
systems such as Windows. | ||
|
||
This is needed only for ``py.path.local``; ``pathlib.Path`` handles this | ||
natively with ``resolve()``.""" | ||
return type(path)(normcase(str(path.realpath()))) |
Uh oh!
There was an error while loading. Please reload this page.