Issue 14407: concurrent.futures tests don't adher to test_cases protocol (original) (raw)

Created on 2012-03-25 18:44 by anacrolix, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_concurrent_futures-load_tests-protocol.patch anacrolix,2012-03-25 18:44 review
Messages (5)
msg156766 - (view) Author: Matt Joiner (anacrolix) Date: 2012-03-25 18:44
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.
msg199990 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-15 10:25
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__).
msg200020 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-15 21:24
New changeset 38243a0a1f44 by Antoine Pitrou in branch '3.3': Issue #14407: Fix unittest test discovery in test_concurrent_futures. http://hg.python.org/cpython/rev/38243a0a1f44 New changeset 9cc40bc5f02b by Antoine Pitrou in branch 'default': Issue #14407: Fix unittest test discovery in test_concurrent_futures. http://hg.python.org/cpython/rev/9cc40bc5f02b
msg200021 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-15 21:25
Fixed, thanks for reporting!
msg200032 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-10-16 01:31
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
History
Date User Action Args
2022-04-11 14:57:28 admin set github: 58615
2013-10-16 01:31:30 zach.ware set nosy: + serhiy.storchaka, zach.waremessages: +
2013-10-15 21:25:15 pitrou set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2013-10-15 21:24:56 python-dev set nosy: + python-devmessages: +
2013-10-15 10:25:37 pitrou set versions: + Python 3.4, - Python 3.2nosy: + pitroumessages: + stage: patch review
2013-10-14 13:56:57 georg.brandl set nosy: + bquinlan
2012-03-25 18:45:09 anacrolix set type: enhancement
2012-03-25 18:44:35 anacrolix create