Skip to content

Commit 3f23ad4

Browse files
committed
more win32 shenanigans
1 parent 3efc0d8 commit 3f23ad4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

testing/path/test_local.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,11 +1116,15 @@ def test_behavior_with_bytes(): # type: () -> None
11161116
assert p1 / brelpath == local("") / local("bytesname")
11171117
assert str(p1 / brelpath) == str(local("") / local("bytesname"))
11181118
else:
1119-
assert p1 / brelpath != local("") / local("bytesname")
1120-
with pytest.raises(
1121-
TypeError, match=r"__str__ returned non-string \(type bytes\)"
1122-
):
1123-
str(p1 / brelpath)
1119+
if sys.platform == "win32":
1120+
pytest.raises(TypeError, "a bytes-like object is required, not 'str'"):
1121+
p1 / brelpath
1122+
else:
1123+
assert p1 / brelpath != local("") / local("bytesname")
1124+
with pytest.raises(
1125+
TypeError, match=r"__str__ returned non-string \(type bytes\)"
1126+
):
1127+
str(p1 / brelpath)
11241128

11251129
strpath = (p1 / brelpath).strpath.decode()
11261130
assert strpath == str(local("") / local("bytesname"))

0 commit comments

Comments
 (0)