fix test_unsupported_hashes for windows

This commit is contained in:
Xavier Fernandez 2015-12-01 12:38:39 +01:00
parent 9cf0342de3
commit b939c3d6d2
1 changed files with 5 additions and 1 deletions

View File

@ -161,6 +161,9 @@ class TestRequirementSet(object):
'file',
2))[0])
finder = PackageFinder([data.find_links], [], session=PipSession())
sep = os.path.sep
if sep == '\\':
sep = '\\\\' # This needs to be escaped for the regex
assert_raises_regexp(
HashErrors,
r"Can't verify hashes for these requirements because we don't "
@ -169,7 +172,8 @@ class TestRequirementSet(object):
r"\(line 1\)\)\n"
r"Can't verify hashes for these file:// requirements because they "
r"point to directories:\n"
r" file:///.*/data/packages/FSPkg \(from -r file \(line 2\)\)",
r" file://.*{sep}data{sep}packages{sep}FSPkg "
"\(from -r file \(line 2\)\)".format(sep=sep),
reqset.prepare_files,
finder)