Message223366
Here's a patch against 3.4 implementing Serhiy's suggestion in msg223277 and taking it a step further, actually using test discovery in all of the test.test_* subpackages.
To reduce duplication, the patch adds a 'load_package_tests' function to test.support, which is then used in each of the subpackages' load_tests function.
test_json and test_tools should have no visible changes from this patch. test_asyncio and test_email do have slight differences, but only in verbosity level: pre-patch, `python -m test.test_(asyncio|email)` runs at verbosity=2 (support.run_unittest default); with patch, they run at verbosity=1 (unittest default). test_asyncio also reports one more skipped test on Windows, due to a module that raises SkipTest on import.
@Brett: test_importlib sees the most changes, and I'd like to be sure that things are as you expect them to be. It looks like all of the test_suite() stuff is unused leftovers from when "test_importlib" was "importlib.test" and that test_importlib has actually been relying on unittest discovery (but bypassing load_tests and thereby not working with `python -m unittest test.test_importlib`), but I'd like confirmation on that.
A nice bonus with this patch is that (for example) `python -m test.test_importlib.source` works, testing just the named test_importlib subpackage. |
|
Date |
User |
Action |
Args |
2014-07-17 20:09:20 | zach.ware | set | recipients:
+ zach.ware, brett.cannon, ezio.melotti, berker.peksag, serhiy.storchaka |
2014-07-17 20:09:20 | zach.ware | set | messageid: <1405627760.3.0.397447180395.issue22002@psf.upfronthosting.co.za> |
2014-07-17 20:09:20 | zach.ware | link | issue22002 messages |
2014-07-17 20:09:20 | zach.ware | create | |
|