Use cross platform Path compatibility module in test.

This commit is contained in:
Chris Miller
2018-11-16 11:50:25 -05:00
parent 65e49f1bff
commit 70f6bec85e
+3 -3
View File
@@ -359,15 +359,15 @@ def test_multiple_editable_packages_should_not_race(PipenvInstance, pypi, tmpdir
"""
# Unzip tarballs to known location, and update Pipfile template.
for pkg_name, file_name in pkgs.items():
source_path = os.path.abspath(os.path.join(testsroot, "pypi", file_name))
unzip_path = tmpdir.join(pkg_name)
source_path = str(Path(testsroot, "pypi", file_name))
unzip_path = str(Path(tmpdir.strpath, pkg_name))
import tarfile
with tarfile.open(source_path, "r:gz") as tgz:
tgz.extractall(path=tmpdir.strpath)
pipfile_string += '"{0}" = {{path = "{1}", editable = true}}\n'.format(pkg_name, unzip_path.strpath)
pipfile_string += "'{0}' = {{path = '{1}', editable = true}}\n".format(pkg_name, unzip_path)
with PipenvInstance(pypi=pypi, chdir=True) as p:
print(pipfile_string)