Skip to content
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

force / in actual_path() on Windows #1409

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions coverage/files.py
Expand Up @@ -343,6 +343,7 @@ def add(self, pattern, result):
match an entire tree, and not just its root.

"""
pattern = pattern.replace("\\", "/")
pattern_sep = sep(pattern)

if len(pattern) > 1:
Expand Down
1 change: 1 addition & 0 deletions coverage/sqldata.py
Expand Up @@ -384,6 +384,7 @@ def _file_id(self, filename, add=False):
If filename is not in the database yet, add it if `add` is True.
If `add` is not True, return None.
"""
filename = filename.replace("\\", "/")
if filename not in self._file_map:
if add:
with self._connect() as con:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_files.py
Expand Up @@ -428,4 +428,4 @@ class WindowsFileTest(CoverageTest):
run_in_temp_dir = False

def test_actual_path(self):
assert actual_path(r'c:\Windows') == actual_path(r'C:\wINDOWS')
assert actual_path(r'c:/Windows') == actual_path(r'C:\wINDOWS')