diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2003-12-03 22:16:47 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2003-12-03 22:16:47 (GMT) |
commit | 2e8624c21ad0808bad02a2cf907d9a266f9c99d8 (patch) | |
tree | e2be9b0c72f723fab3b69c1ba202b90707cc9011 /Lib/test/test_unicode_file.py | |
parent | 07f1dfa91cd74fbdad9f88ea6aa80249cd0ada14 (diff) | |
download | cpython-2e8624c21ad0808bad02a2cf907d9a266f9c99d8.zip cpython-2e8624c21ad0808bad02a2cf907d9a266f9c99d8.tar.gz cpython-2e8624c21ad0808bad02a2cf907d9a266f9c99d8.tar.bz2 |
Fix test_unicode_file errors on platforms without Unicode file support,
by setting TESTFN_UNICODE_UNENCODEABLE on these platforms.
test_unicode_file only attempts to use the name for testing if not None.
Diffstat (limited to 'Lib/test/test_unicode_file.py')
-rw-r--r-- | Lib/test/test_unicode_file.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index 467b78e..fbca88b 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -140,7 +140,8 @@ class TestUnicodeFiles(unittest.TestCase): def test_single_files(self): self._test_single(TESTFN_ENCODED) self._test_single(TESTFN_UNICODE) - self._test_single(TESTFN_UNICODE_UNENCODEABLE) + if TESTFN_UNICODE_UNENCODEABLE is not None: + self._test_single(TESTFN_UNICODE_UNENCODEABLE) def test_equivalent_files(self): self._test_equivalent(TESTFN_ENCODED, TESTFN_UNICODE) @@ -156,9 +157,10 @@ class TestUnicodeFiles(unittest.TestCase): self._do_directory(TESTFN_UNICODE+ext, TESTFN_ENCODED+ext, os.getcwdu) self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, os.getcwdu) # Our directory name that can't use a non-unicode name. - self._do_directory(TESTFN_UNICODE_UNENCODEABLE+ext, - TESTFN_UNICODE_UNENCODEABLE+ext, - os.getcwdu) + if TESTFN_UNICODE_UNENCODEABLE is not None: + self._do_directory(TESTFN_UNICODE_UNENCODEABLE+ext, + TESTFN_UNICODE_UNENCODEABLE+ext, + os.getcwdu) def test_main(): suite = unittest.TestSuite() |