Skip to content

Commit 6a7832f

Browse files
committed
Adjust tests to work in Windows
1 parent 5826d6b commit 6a7832f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

test/test_library.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,13 @@ def _setf(self, fmt):
559559
def _assert_dest(self, dest, i=None):
560560
if i is None:
561561
i = self.i
562-
with _common.platform_posix():
563-
actual = i.destination()
562+
563+
if os.path.sep != "/":
564+
dest = dest.replace(b"/", os.path.sep.encode())
565+
dest = b"D:" + dest
566+
567+
actual = i.destination()
568+
564569
assert actual == dest
565570

566571

test/test_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ def _patch_max_filename_length(self, monkeypatch):
185185
],
186186
)
187187
def test_truncate(self, path, expected):
188+
path = path.replace("/", os.path.sep)
189+
expected = expected.replace("/", os.path.sep)
190+
188191
assert util.truncate_path(path) == expected
189192

190193
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)