summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-07 10:09:35 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-07 10:09:35 (GMT)
commit6c6f851eae204c3a4f85108c3d564133d58c887a (patch)
tree555d578c77274ff79bf957d7f87dbd9a67c857f3 /Lib/test/test_import.py
parent87c9d6cf9cbf2cada6a309cf4e46d77c3484b4c2 (diff)
downloadcpython-6c6f851eae204c3a4f85108c3d564133d58c887a.zip
cpython-6c6f851eae204c3a4f85108c3d564133d58c887a.tar.gz
cpython-6c6f851eae204c3a4f85108c3d564133d58c887a.tar.bz2
Issue #9425: skip tests if a filename is not encodable
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 447c17f..11cf544 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -291,6 +291,11 @@ class ImportTests(unittest.TestCase):
def test_import_by_filename(self):
path = os.path.abspath(TESTFN)
+ encoding = sys.getfilesystemencoding()
+ try:
+ path.encode(encoding)
+ except UnicodeEncodeError:
+ self.skipTest('path is not encodable to {}'.format(encoding))
with self.assertRaises(ImportError) as c:
__import__(path)
self.assertEqual("Import by filename is not supported.",