diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-01-18 06:55:05 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-01-18 06:55:05 (GMT) |
commit | 2c5c79cfc477c0537f296fa3ce7289dbc9a72c83 (patch) | |
tree | 1feeac55b8bbf27bf03a0ef8ff04c681153f0ca3 /Lib/importlib/test/support.py | |
parent | b0516a6bc6cdc580846b075bc27b1d3281dd6295 (diff) | |
download | cpython-2c5c79cfc477c0537f296fa3ce7289dbc9a72c83.zip cpython-2c5c79cfc477c0537f296fa3ce7289dbc9a72c83.tar.gz cpython-2c5c79cfc477c0537f296fa3ce7289dbc9a72c83.tar.bz2 |
Tests of case-sensitivity were being executed on OSs which did not have a
case-insensitive file system, leading to test failures. This was due to using
the TestCase objects directly instead of the guard in the test_main() function.
Move over to a class decorator instead to control if the tests should be run.
Diffstat (limited to 'Lib/importlib/test/support.py')
-rw-r--r-- | Lib/importlib/test/support.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/importlib/test/support.py b/Lib/importlib/test/support.py index 4e63cd1..3097811 100644 --- a/Lib/importlib/test/support.py +++ b/Lib/importlib/test/support.py @@ -36,6 +36,16 @@ def writes_bytecode(fxn): else: return fxn + +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'): + return object() + else: + return class_ + + @contextmanager def uncache(*names): """Uncache a module from sys.modules. |