classification
Title: concurrent.futures tests don't adher to test_cases protocol
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: anacrolix, bquinlan, pitrou, python-dev, serhiy.storchaka, zach.ware
Priority: normal Keywords: patch

Created on 2012-03-25 18:44 by anacrolix, last changed 2013-10-16 01:31 by zach.ware. 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) 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; issue16968 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
2013-10-16 01:31:30zach.waresetnosy: + serhiy.storchaka, zach.ware
messages: + msg200032
2013-10-15 21:25:15pitrousetstatus: open -> closed
resolution: fixed
messages: + msg200021

stage: patch review -> resolved
2013-10-15 21:24:56python-devsetnosy: + python-dev
messages: + msg200020
2013-10-15 10:25:37pitrousetversions: + Python 3.4, - Python 3.2
nosy: + pitrou

messages: + msg199990

stage: patch review
2013-10-14 13:56:57georg.brandlsetnosy: + bquinlan
2012-03-25 18:45:09anacrolixsettype: enhancement
2012-03-25 18:44:35anacrolixcreate