[issue16662] load_tests not invoked in package/__init__.py
Barry A. Warsaw
report at bugs.python.org
Wed Jul 31 23:13:34 CEST 2013
Barry A. Warsaw added the comment:
Hah, I just ran into this too. I was perplexed why my load_tests() function wasn't being called and ended up pdb'ing unittest's discover, and found exactly this problem. I'm not surprised lifeless beat me to it.
(My use case was to piggyback on load_tests() to implement a package fixture, similar to what nose provides.)
Note that in http://docs.python.org/3/library/unittest.html#load-tests-protocol the docs even give you a recipe for a "no-op" load_tests() which would have been perfect, except for this problem with pattern matching the directory.
My preference would be to remove the pattern match on the path. I agree that the presence of a load_tests() is probably enough of an opt-in. The question is whether we could classify this change as a bug fix or new feature. I'd love to see this fixed in 3.3 so I'm hoping for the former.
----------
nosy: +barry
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16662>
_______________________________________
More information about the Python-bugs-list
mailing list