diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-05-07 20:45:07 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-05-07 20:45:07 (GMT) |
commit | 1a0ce685abfbe9343f64c28d888f5b28658093a0 (patch) | |
tree | 1d6b2e3236a272f0145f6596b17b54b2b3eebb9d /Lib/unittest/loader.py | |
parent | 5dfad9dc9a93ad78f56de4042ac2f3b45dd51a7b (diff) | |
download | cpython-1a0ce685abfbe9343f64c28d888f5b28658093a0.zip cpython-1a0ce685abfbe9343f64c28d888f5b28658093a0.tar.gz cpython-1a0ce685abfbe9343f64c28d888f5b28658093a0.tar.bz2 |
revert r80932; it breaks windows
Diffstat (limited to 'Lib/unittest/loader.py')
-rw-r--r-- | Lib/unittest/loader.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py index a6fb95d..360a41e 100644 --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -173,10 +173,7 @@ class TestLoader(object): if not top_level_dir in sys.path: # all test modules must be importable from the top level directory - # should we *unconditionally* put the start directory in first - # in sys.path to minimise likelihood of conflicts between installed - # modules and development versions? - sys.path.insert(0, top_level_dir) + sys.path.append(top_level_dir) self._top_level_dir = top_level_dir is_not_importable = False @@ -249,16 +246,6 @@ class TestLoader(object): except: yield _make_failed_import_test(name, self.suiteClass) else: - mod_file = os.path.abspath(getattr(module, '__file__', full_path)) - realpath = os.path.splitext(mod_file)[0] - fullpath_noext = os.path.splitext(full_path)[0] - if realpath.lower() != fullpath_noext.lower(): - module_dir = os.path.dirname(realpath) - mod_name = os.path.splitext(os.path.basename(full_path))[0] - expected_dir = os.path.dirname(full_path) - msg = ("%r module incorrectly imported from %r. Expected %r. " - "Is this module globally installed?") - raise ImportError(msg % (mod_name, module_dir, expected_dir)) yield self.loadTestsFromModule(module) elif os.path.isdir(full_path): if not os.path.isfile(os.path.join(full_path, '__init__.py')): |