Claudiu.Popa added the comment:

Yes, it iterates over every member of the namespace path. The new attached 
patch fixes this behaviour, by checking that each loader path starts with 
top_level_dir when set_implicit_top is False (if set_implicit_top is True, 
top_level_dir is irrelevant, start_dir will be the package name).

 Also, with the original patch there were other issues:
  1. if no tests were found for the namespace package, the same failure as 
before would have occurred at the lines:

  +        if not tests:
  +            tests = list(self._find_tests(start_dir, pattern))

  2. it iterated every subfolder, by dropping the check for __init__.py. To fix 
this, I added a new keyword argument to _find_tests, `namespace` which defaults 
to False. If it is True, then we are checking a namespace package and 
subfolders will be checked even if they don't have a __init__.py file.

----------
Added file: http://bugs.python.org/file29556/unittest-17457.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17457>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to