Message162379
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. |
|
Date |
User |
Action |
Args |
2012-06-05 22:49:16 | michael.foord | set | recipients:
+ michael.foord, r.david.murray |
2012-06-05 22:49:16 | michael.foord | set | messageid: <1338936556.46.0.867654624624.issue15007@psf.upfronthosting.co.za> |
2012-06-05 22:49:15 | michael.foord | link | issue15007 messages |
2012-06-05 22:49:15 | michael.foord | create | |
|