Skip to content

Commit 43d749c

Browse files
committed
tests: handle paths on Windows
1 parent e15e969 commit 43d749c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

spin/tests/test_build_cmds.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import subprocess
33
import sys
44
import tempfile
5-
from pathlib import Path
5+
from pathlib import Path, PureWindowsPath
66

77
import pytest
88

@@ -19,6 +19,10 @@
1919
)
2020

2121

22+
def unix_path(p: str) -> str:
23+
return PureWindowsPath(p).as_posix()
24+
25+
2226
def test_basic_build(example_pkg):
2327
"""Does the package build?"""
2428
spin("build")
@@ -178,7 +182,7 @@ def test_parallel_builds(example_pkg):
178182
spin("build")
179183
spin("build", "-C", "parallel/build")
180184
p = spin("python", "--", "-c", "import example_pkg; print(example_pkg.__file__)")
181-
example_pkg_path = stdout(p).split("\n")[-1]
185+
example_pkg_path = unix_path(stdout(p).split("\n")[-1])
182186
p = spin(
183187
"python",
184188
"-C",
@@ -187,7 +191,7 @@ def test_parallel_builds(example_pkg):
187191
"-c",
188192
"import example_pkg; print(example_pkg.__file__)",
189193
)
190-
example_pkg_parallel_path = stdout(p).split("\n")[-1]
194+
example_pkg_parallel_path = unix_path(stdout(p).split("\n")[-1])
191195
assert "build-install" in example_pkg_path
192196
assert "parallel/build-install" in example_pkg_parallel_path
193197
assert "parallel/build-install" not in example_pkg_path

0 commit comments

Comments
 (0)