diff options
author | Brett Cannon <brett@python.org> | 2016-08-27 16:42:40 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-08-27 16:42:40 (GMT) |
commit | 3ce2fd484bd2cccb546bf05ff6057ffaa75b1e29 (patch) | |
tree | 92bc54ba2861634d6f6187072eca4c9243cc5fba /Lib/test/test_os.py | |
parent | 1b6c6da85d7fd268825e09cc8ff339540c1f77bc (diff) | |
download | cpython-3ce2fd484bd2cccb546bf05ff6057ffaa75b1e29.zip cpython-3ce2fd484bd2cccb546bf05ff6057ffaa75b1e29.tar.gz cpython-3ce2fd484bd2cccb546bf05ff6057ffaa75b1e29.tar.bz2 |
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.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 8c6a8c0..dfffed2 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: |