From 2e8624c21ad0808bad02a2cf907d9a266f9c99d8 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Wed, 3 Dec 2003 22:16:47 +0000 Subject: 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. --- Lib/test/test_unicode_file.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Lib/test/test_unicode_file.py') diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index 467b78ec16..fbca88b221 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() -- cgit v1.2.1