[issue16662] load_tests not invoked in package/__init__.py

Barry A. Warsaw report at bugs.python.org
Fri Oct 18 17:16:12 CEST 2013


Barry A. Warsaw added the comment:

The failure in test_discovery.py is odd.  It's failing because loadTestsFromModule() is being passed a keyword arguemnt use_load_tests=False.

On the surface, the failure makes sense because if you look in test_discover.py, it's defining a lambda for loader.loadTestsFromModule that takes only one argument, the module name.

But the deeper question is why self.loadTestsFromModule() is being passed use_load_tests=False?  loadTestsFromModule() is documented to take *only* the module name:

http://docs.python.org/3/library/unittest.html#unittest.TestLoader.loadTestsFromModule

But then if you look at loader.py, loadTestsFromModule does indeed take an undocumented use_load_tests keyword argument.

So it seems like there's two problems here.  use_load_tests is undocumented, and the lambda in test_discovery.py should take that keyword argument.  Michael, can you weigh in on this?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16662>
_______________________________________


More information about the Python-bugs-list mailing list