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 michael.foord
Recipients michael.foord, r.david.murray
Date 2012-06-05.22:49:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338936556.46.0.867654624624.issue15007@psf.upfronthosting.co.za>
In-reply-to
Content
Whilst I agree in principle... The trouble is that when you do this:

    python -m unittest test_pk

What you are saying is "run all the tests from the test_pk module". You *aren't* launching discovery. 

This should work:

    python -m unittest discover -t . test_pkg

This is more verbose than is ideal. Suggestions for improvements welcome. Having unittest revert to discovery when it is passed a package name that turns out to be empty seems a bit magical (and complex in terms of implementation).

Yes, calling loader.discover inside a load_tests function will mutate that loader - so having discover restore _top_level_dir on exit would be better. Can you post that as a separate issue?

I think there is a separate issue for improving the test failure name (including module) reporting. I'll try and dig out the issue number.
History
Date User Action Args
2012-06-05 22:49:16michael.foordsetrecipients: + michael.foord, r.david.murray
2012-06-05 22:49:16michael.foordsetmessageid: <1338936556.46.0.867654624624.issue15007@psf.upfronthosting.co.za>
2012-06-05 22:49:15michael.foordlinkissue15007 messages
2012-06-05 22:49:15michael.foordcreate