]> granicus.if.org Git - python/commitdiff
Check that on a platform that is expected to have a case-insensitive filesystem
authorBrett Cannon <bcannon@gmail.com>
Thu, 2 Apr 2009 05:17:54 +0000 (05:17 +0000)
committerBrett Cannon <bcannon@gmail.com>
Thu, 2 Apr 2009 05:17:54 +0000 (05:17 +0000)
that is in fact the case.

Closes issue #5442.

Lib/importlib/test/util.py

index 2698ef43d0536cf43a5da4cb34688e43b57fedd5..0fe31a1e20ac1155af4e0e62cd63effa05316c1d 100644 (file)
@@ -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_