Commit bbab4e66 by Sébastien Eustace

Fix tests for Windows

parent cb79ffb3
...@@ -54,7 +54,7 @@ class Builder(object): ...@@ -54,7 +54,7 @@ class Builder(object):
explicitely_excluded = set() explicitely_excluded = set()
for excluded_glob in self._package.exclude: for excluded_glob in self._package.exclude:
for excluded in self._path.glob(excluded_glob): for excluded in self._path.glob(excluded_glob):
explicitely_excluded.add(str(excluded.relative_to(self._path))) explicitely_excluded.add(excluded.relative_to(self._path).as_posix())
ignored = vcs_ignored_files | explicitely_excluded ignored = vcs_ignored_files | explicitely_excluded
result = set() result = set()
...@@ -68,7 +68,7 @@ class Builder(object): ...@@ -68,7 +68,7 @@ class Builder(object):
def is_excluded(self, filepath): # type: (Union[str, Path]) -> bool def is_excluded(self, filepath): # type: (Union[str, Path]) -> bool
if not isinstance(filepath, basestring): if not isinstance(filepath, basestring):
filepath = str(filepath) filepath = filepath.as_posix()
return filepath in self.find_excluded_files() return filepath in self.find_excluded_files()
......
...@@ -438,7 +438,7 @@ def test_default_with_excluded_data(mocker): ...@@ -438,7 +438,7 @@ def test_default_with_excluded_data(mocker):
# Patch git module to return specific excluded files # Patch git module to return specific excluded files
p = mocker.patch("poetry.vcs.git.Git.get_ignored_files") p = mocker.patch("poetry.vcs.git.Git.get_ignored_files")
p.return_value = [ p.return_value = [
str( (
( (
Path(__file__).parent Path(__file__).parent
/ "fixtures" / "fixtures"
...@@ -447,7 +447,9 @@ def test_default_with_excluded_data(mocker): ...@@ -447,7 +447,9 @@ def test_default_with_excluded_data(mocker):
/ "data" / "data"
/ "sub_data" / "sub_data"
/ "data2.txt" / "data2.txt"
).relative_to(project("default_with_excluded_data")) )
.relative_to(project("default_with_excluded_data"))
.as_posix()
) )
] ]
poetry = Poetry.create(project("default_with_excluded_data")) poetry = Poetry.create(project("default_with_excluded_data"))
......
...@@ -1295,14 +1295,14 @@ def test_solver_can_resolve_directory_dependencies(solver, repo, package): ...@@ -1295,14 +1295,14 @@ def test_solver_can_resolve_directory_dependencies(solver, repo, package):
pendulum = get_package("pendulum", "2.0.3") pendulum = get_package("pendulum", "2.0.3")
repo.add_package(pendulum) repo.add_package(pendulum)
path = str( path = s(
Path(__file__).parent.parent Path(__file__).parent.parent
/ "fixtures" / "fixtures"
/ "git" / "git"
/ "github.com" / "github.com"
/ "demo" / "demo"
/ "demo" / "demo"
) ).as_posix()
package.add_dependency("demo", {"path": path}) package.add_dependency("demo", {"path": path})
...@@ -1330,14 +1330,14 @@ def test_solver_can_resolve_directory_dependencies_with_extras(solver, repo, pac ...@@ -1330,14 +1330,14 @@ def test_solver_can_resolve_directory_dependencies_with_extras(solver, repo, pac
repo.add_package(pendulum) repo.add_package(pendulum)
repo.add_package(cleo) repo.add_package(cleo)
path = str( path = (
Path(__file__).parent.parent Path(__file__).parent.parent
/ "fixtures" / "fixtures"
/ "git" / "git"
/ "github.com" / "github.com"
/ "demo" / "demo"
/ "demo" / "demo"
) ).as_posix()
package.add_dependency("demo", {"path": path, "extras": ["foo"]}) package.add_dependency("demo", {"path": path, "extras": ["foo"]})
...@@ -1364,12 +1364,12 @@ def test_solver_can_resolve_sdist_dependencies(solver, repo, package): ...@@ -1364,12 +1364,12 @@ def test_solver_can_resolve_sdist_dependencies(solver, repo, package):
pendulum = get_package("pendulum", "2.0.3") pendulum = get_package("pendulum", "2.0.3")
repo.add_package(pendulum) repo.add_package(pendulum)
path = str( path = (
Path(__file__).parent.parent Path(__file__).parent.parent
/ "fixtures" / "fixtures"
/ "distributions" / "distributions"
/ "demo-0.1.0.tar.gz" / "demo-0.1.0.tar.gz"
) ).as_posix()
package.add_dependency("demo", {"path": path}) package.add_dependency("demo", {"path": path})
...@@ -1397,12 +1397,12 @@ def test_solver_can_resolve_sdist_dependencies_with_extras(solver, repo, package ...@@ -1397,12 +1397,12 @@ def test_solver_can_resolve_sdist_dependencies_with_extras(solver, repo, package
repo.add_package(pendulum) repo.add_package(pendulum)
repo.add_package(cleo) repo.add_package(cleo)
path = str( path = (
Path(__file__).parent.parent Path(__file__).parent.parent
/ "fixtures" / "fixtures"
/ "distributions" / "distributions"
/ "demo-0.1.0.tar.gz" / "demo-0.1.0.tar.gz"
) ).as_posix()
package.add_dependency("demo", {"path": path, "extras": ["foo"]}) package.add_dependency("demo", {"path": path, "extras": ["foo"]})
...@@ -1429,12 +1429,12 @@ def test_solver_can_resolve_wheel_dependencies(solver, repo, package): ...@@ -1429,12 +1429,12 @@ def test_solver_can_resolve_wheel_dependencies(solver, repo, package):
pendulum = get_package("pendulum", "2.0.3") pendulum = get_package("pendulum", "2.0.3")
repo.add_package(pendulum) repo.add_package(pendulum)
path = str( path = (
Path(__file__).parent.parent Path(__file__).parent.parent
/ "fixtures" / "fixtures"
/ "distributions" / "distributions"
/ "demo-0.1.0-py2.py3-none-any.whl" / "demo-0.1.0-py2.py3-none-any.whl"
) ).as_posix()
package.add_dependency("demo", {"path": path}) package.add_dependency("demo", {"path": path})
...@@ -1462,12 +1462,12 @@ def test_solver_can_resolve_wheel_dependencies_with_extras(solver, repo, package ...@@ -1462,12 +1462,12 @@ def test_solver_can_resolve_wheel_dependencies_with_extras(solver, repo, package
repo.add_package(pendulum) repo.add_package(pendulum)
repo.add_package(cleo) repo.add_package(cleo)
path = str( path = (
Path(__file__).parent.parent Path(__file__).parent.parent
/ "fixtures" / "fixtures"
/ "distributions" / "distributions"
/ "demo-0.1.0-py2.py3-none-any.whl" / "demo-0.1.0-py2.py3-none-any.whl"
) ).as_posix()
package.add_dependency("demo", {"path": path, "extras": ["foo"]}) package.add_dependency("demo", {"path": path, "extras": ["foo"]})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment