This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix test discovery for test_future*
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: brett.cannon, ezio.melotti, python-dev, zach.ware
Priority: normal Keywords: patch

Created on 2013-02-26 21:38 by zach.ware, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_future_discovery.diff zach.ware, 2013-02-26 21:38 review
Messages (4)
msg183092 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-02-26 21:38
Here's the fix for test discovery of test_future* (particularly test_future3).  Without the patch, running 'python -m unittest discover Lib/test/ "test_future*"' results in an error in test_future3.py, due to test_future.py's FutureTest.test_future3 removing test_future3 from sys.modules by way of support.unload.  The patch replaces all instances of support.unload with a support.CleanImport context manager.

The patch also replaces test_main() in all test_future*.py modules, just for good measure.
msg183093 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-02-26 21:40
Correction: ...all instances of support.unload *in test_future.py* with support.CleanImport...
msg183118 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-02-27 08:01
New changeset 83ae10bf608c by Ezio Melotti in branch '3.3':
#17303: test_future* now work with unittest test discovery.  Patch by Zachary Ware.
http://hg.python.org/cpython/rev/83ae10bf608c

New changeset 5599bbc275bc by Ezio Melotti in branch 'default':
#17303: merge with 3.3.
http://hg.python.org/cpython/rev/5599bbc275bc
msg183119 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-02-27 08:03
Fixed, thanks for the patch!
I also removed a some "from test import support" that were no longer necessary.

test_future files could be reorganized a bit, since they are basically no-ops, and they aren't testing much.
History
Date User Action Args
2022-04-11 14:57:42adminsetgithub: 61505
2013-02-27 08:03:53ezio.melottisetstatus: open -> closed
messages: + msg183119

assignee: ezio.melotti
resolution: fixed
stage: resolved
2013-02-27 08:01:23python-devsetnosy: + python-dev
messages: + msg183118
2013-02-26 21:40:08zach.waresetmessages: + msg183093
2013-02-26 21:38:25zach.warecreate