diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-23 17:15:05 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-23 17:15:05 (GMT) |
commit | 6c6b3f770d0b54eeb3e42b38e1fe5d893c38dd6e (patch) | |
tree | 6f6f93e241e5fe83fb3822d92eaa80f2a5f862df /Lib/unittest/loader.py | |
parent | 3d3e1ba8ac9d759394a76a3da4c47247b3120be3 (diff) | |
parent | d5d0bc35adc6c043d5985152451505e70d869341 (diff) | |
download | cpython-6c6b3f770d0b54eeb3e42b38e1fe5d893c38dd6e.zip cpython-6c6b3f770d0b54eeb3e42b38e1fe5d893c38dd6e.tar.gz cpython-6c6b3f770d0b54eeb3e42b38e1fe5d893c38dd6e.tar.bz2 |
Issue #19352: Fix unittest discovery when a module can be reached through several paths (e.g. under Debian/Ubuntu with virtualenv).
Diffstat (limited to 'Lib/unittest/loader.py')
-rw-r--r-- | Lib/unittest/loader.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py index ad89cd0..e872fcc 100644 --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -276,8 +276,8 @@ class TestLoader(object): yield _make_failed_import_test(name, self.suiteClass) else: mod_file = os.path.abspath(getattr(module, '__file__', full_path)) - realpath = _jython_aware_splitext(mod_file) - fullpath_noext = _jython_aware_splitext(full_path) + realpath = _jython_aware_splitext(os.path.realpath(mod_file)) + fullpath_noext = _jython_aware_splitext(os.path.realpath(full_path)) if realpath.lower() != fullpath_noext.lower(): module_dir = os.path.dirname(realpath) mod_name = _jython_aware_splitext(os.path.basename(full_path)) |