[Python-checkins] r71042 - python/branches/py3k/Lib/importlib/test/util.py
brett.cannon
python-checkins at python.org
Thu Apr 2 07:17:54 CEST 2009
Author: brett.cannon
Date: Thu Apr 2 07:17:54 2009
New Revision: 71042
Log:
Check that on a platform that is expected to have a case-insensitive filesystem
that is in fact the case.
Closes issue #5442.
Modified:
python/branches/py3k/Lib/importlib/test/util.py
Modified: python/branches/py3k/Lib/importlib/test/util.py
==============================================================================
--- python/branches/py3k/Lib/importlib/test/util.py (original)
+++ python/branches/py3k/Lib/importlib/test/util.py Thu Apr 2 07:17:54 2009
@@ -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 @@
"""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_
More information about the Python-checkins
mailing list