summaryrefslogtreecommitdiff
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-08-27 09:42:40 -0700
committerBrett Cannon <brett@python.org>2016-08-27 09:42:40 -0700
commit7e445b494a0b2834d33648c2b2ca0f449e56319a (patch)
tree8d29e1a21af42a4bc70b664e9adf7201da29f022 /Lib/test/test_os.py
parentcfca21d2c0676e30605feffdd4012b631163dedc (diff)
downloadcpython-7e445b494a0b2834d33648c2b2ca0f449e56319a.tar.gz
Don't test for path-like bytes paths on Windows
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 8c6a8c0815..dfffed2720 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -2841,14 +2841,17 @@ class PathTConverterTests(unittest.TestCase):
return self.path
str_filename = support.TESTFN
- bytes_filename = support.TESTFN.encode('ascii')
+ if os.name == 'nt':
+ bytes_fspath = bytes_filename = None
+ else:
+ bytes_filename = support.TESTFN.encode('ascii')
+ bytes_fspath = PathLike(bytes_filename)
fd = os.open(PathLike(str_filename), os.O_WRONLY|os.O_CREAT)
self.addCleanup(os.close, fd)
self.addCleanup(support.unlink, support.TESTFN)
int_fspath = PathLike(fd)
str_fspath = PathLike(str_filename)
- bytes_fspath = PathLike(bytes_filename)
for name, allow_fd, extra_args, cleanup_fn in self.functions:
with self.subTest(name=name):
@@ -2859,6 +2862,8 @@ class PathTConverterTests(unittest.TestCase):
for path in (str_filename, bytes_filename, str_fspath,
bytes_fspath):
+ if path is None:
+ continue
with self.subTest(name=name, path=path):
result = fn(path, *extra_args)
if cleanup_fn is not None: