mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #19352: Fix unittest discovery when a module can be reached through several paths (e.g. under Debian/Ubuntu with virtualenv).
This commit is contained in:
commit
6c6b3f770d
3 changed files with 28 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue