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 <rep...@bugs.python.org>
<http://bugs.python.org/issue16662>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to