matt@matt-1005P:~/src/cpython$ ./python -m unittest test.test_concurrent_futures Ran 79 tests in 62.554s FAILED (errors=18) Failures are due to test discovery picking up unintentionally exposed tests. By adhering to the test_cases protocol introduced in 3.2, this doesn't occur. Patch attached.
I think the better solution would be to fix the test inheritance hierarchy: only concrete test classes should inherit from unittest.TestCase. Then the code can be simplified by simply calling unittest.main(__name__).
I had missed this issue before; tracks the same thing. There are a couple of issues that the committed patch doesn't address. Namely, the file still uses test_main, and there is no thread or process reaping when running the file via discovery. Unfortunately, there's no clear-cut best solution in the other issue. A couple months ago, Serhiy posted a question on python-dev[1] about how to solve it, which I haven't seen any replies to. Antoine, do you have any suggestions? [1] https://mail.python.org/pipermail/python-dev/2013-August/127893.html