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: Cleanup unused and duplicate imports in tests
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, jdufresne, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-01-20 01:17 by jdufresne, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cleanup-unused-imports.patch jdufresne, 2015-01-20 01:17 Patch review
cleanup-unused-imports_2.patch serhiy.storchaka, 2016-04-24 11:45 review
Messages (10)
msg234334 - (view) Author: Jon Dufresne (jdufresne) * Date: 2015-01-20 01:17
Ran variations of the command:

$ find . -wholename '*/test/*.py' | xargs flake8 --select=F401,F811

To look for unused or duplicate imports. The attached patch removes them.
msg234356 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-01-20 07:09
+1 for cleanup.
msg264091 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-24 04:31
New changeset 6958bbf7f0ec by Berker Peksag in branch 'default':
Issue #23277: Remove unused sys and os imports
https://hg.python.org/cpython/rev/6958bbf7f0ec
msg264092 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-24 04:36
Thanks for the patch, Jon.

I only removed sys and os since they were the most unused modules.
msg264103 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-04-24 09:21
Note that setUpModule is correctly imported in Lib/tkinter/test/test_tkinter/test_widgets.py.
msg264106 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-24 10:54
New changeset 9d7f2615f7b3 by Serhiy Storchaka in branch 'default':
Issue #23277: Remove more unused sys and os imports.
https://hg.python.org/cpython/rev/9d7f2615f7b3

New changeset abf3f0dcf2fd by Serhiy Storchaka in branch 'default':
Issue #23277: Remove unused support.run_unittest import.
https://hg.python.org/cpython/rev/abf3f0dcf2fd
msg264107 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-04-24 11:45
Here is the patch that contains the rest of changes, after resolving conflicts and fixing some errors. I have reviewed and tested these changes and they LGTM. I think it is worth to push them.
msg264116 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-24 17:36
LGTM
msg264119 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-24 18:41
New changeset fa44d1bc9b68 by Serhiy Storchaka in branch 'default':
Issue #23277: Remove unused imports in tests.
https://hg.python.org/cpython/rev/fa44d1bc9b68
msg264120 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-04-24 18:43
Thanks Berker.
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67466
2016-04-24 18:43:56serhiy.storchakasetstatus: open -> closed
type: enhancement
messages: + msg264120

resolution: fixed
stage: patch review -> resolved
2016-04-24 18:41:28python-devsetmessages: + msg264119
2016-04-24 17:36:03berker.peksagsetmessages: + msg264116
2016-04-24 11:45:54serhiy.storchakasetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg264107

files: + cleanup-unused-imports_2.patch
2016-04-24 10:54:52python-devsetmessages: + msg264106
2016-04-24 09:21:29serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg264103
2016-04-24 04:36:38berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg264092

versions: + Python 3.6, - Python 3.4, Python 3.5
2016-04-24 04:31:30python-devsetnosy: + python-dev
messages: + msg264091
2015-01-20 07:09:41berker.peksagsetversions: + Python 3.4, Python 3.5, - Python 3.6
nosy: + berker.peksag

messages: + msg234356

stage: patch review
2015-01-20 01:17:43jdufresnecreate