Michael Foord <[email protected]> added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15007>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com