This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, chris.jerdonek, elopio, michael.foord, r.david.murray, rbcollins, vila, zach.ware
Date 2013-07-31.21:13:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375305214.26.0.276843954523.issue16662@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-07-31 21:13:34barrysetrecipients: + barry, rbcollins, vila, r.david.murray, michael.foord, chris.jerdonek, zach.ware, elopio
2013-07-31 21:13:34barrysetmessageid: <1375305214.26.0.276843954523.issue16662@psf.upfronthosting.co.za>
2013-07-31 21:13:34barrylinkissue16662 messages
2013-07-31 21:13:33barrycreate