Skip to content

Commit b939c3d

Browse files
committed
fix test_unsupported_hashes for windows
1 parent 9cf0342 commit b939c3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/unit/test_req.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ def test_unsupported_hashes(self, data):
161161
'file',
162162
2))[0])
163163
finder = PackageFinder([data.find_links], [], session=PipSession())
164+
sep = os.path.sep
165+
if sep == '\\':
166+
sep = '\\\\' # This needs to be escaped for the regex
164167
assert_raises_regexp(
165168
HashErrors,
166169
r"Can't verify hashes for these requirements because we don't "
@@ -169,7 +172,8 @@ def test_unsupported_hashes(self, data):
169172
r"\(line 1\)\)\n"
170173
r"Can't verify hashes for these file:// requirements because they "
171174
r"point to directories:\n"
172-
r" file:///.*/data/packages/FSPkg \(from -r file \(line 2\)\)",
175+
r" file://.*{sep}data{sep}packages{sep}FSPkg "
176+
"\(from -r file \(line 2\)\)".format(sep=sep),
173177
reqset.prepare_files,
174178
finder)
175179

0 commit comments

Comments
 (0)