summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-04-02 05:17:54 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-04-02 05:17:54 (GMT)
commita3d056ed95ff45dbd8abd90f3f816e7953214d80 (patch)
tree42a9f01b992d3502e2d3b2c6b107971f98db50ec /Lib/importlib
parentbd25d337bab79219bf52d17b2832c04c5c6c60da (diff)
downloadcpython-a3d056ed95ff45dbd8abd90f3f816e7953214d80.zip
cpython-a3d056ed95ff45dbd8abd90f3f816e7953214d80.tar.gz
cpython-a3d056ed95ff45dbd8abd90f3f816e7953214d80.tar.bz2
Check that on a platform that is expected to have a case-insensitive filesystem
that is in fact the case. Closes issue #5442.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/test/util.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/importlib/test/util.py b/Lib/importlib/test/util.py
index 2698ef4..0fe31a1 100644
--- a/Lib/importlib/test/util.py
+++ b/Lib/importlib/test/util.py
@@ -1,7 +1,7 @@
from contextlib import contextmanager
import imp
import os.path
-from test.support import unlink
+from test import support
import unittest
import sys
@@ -10,6 +10,13 @@ def case_insensitive_tests(class_):
"""Class decorator that nullifies tests that require a case-insensitive
file system."""
if sys.platform not in ('win32', 'darwin', 'cygwin'):
+ original_name = os.path.listdir('.')[0]
+ if name.upper() != name:
+ changed_name = name.upper()
+ else:
+ changed_name = name.lower()
+ if os.path.exists(changed_name):
+ return class_
return unittest.TestCase
else:
return class_