classification
Title: test_cmd.py does not correctly call reload()
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: BreamoreBoy, Josh.Watson, berker.peksag, eric.araujo, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2012-03-09 01:12 by Josh.Watson, last changed 2014-06-30 01:08 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
test_cmd-reload.patch Josh.Watson, 2012-03-09 01:15 fixes reload in test_coverage review
Messages (8)
msg155200 - (view) Author: Josh Watson (Josh.Watson) Date: 2012-03-09 01:12
The test_coverage function in test_cmd.py calls reload(cmd)
msg155201 - (view) Author: Josh Watson (Josh.Watson) Date: 2012-03-09 01:15
Accidentally submitted before finishing typing. Anyways, it calls "reload(cmd)" in the test_coverage function in test_cmd.py, which does not work anymore given that reload has been moved to imp.

I've uploaded a patch that fixes this.
msg155282 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-03-10 02:25
Thanks for the report and patch.  This begs the question: why does the current buggy code not cause a test failure?
msg155292 - (view) Author: Josh Watson (Josh.Watson) Date: 2012-03-10 05:57
That particular function only gets called by running `./python Lib/test/test_cmd.py -c`, and not through regrtest.py, so I suspect that's why it wasn't noticed before. I just happened to be exploring test files and ran into an unhandled exception when I tried running it with the -c flag, haha.
msg155491 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-03-12 21:59
Ah, right.  Will apply your patch.
msg221810 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-28 18:33
The patch has not been applied to the default or 3.4 branches.
msg221929 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-06-30 01:05
New changeset d943089af1c6 by Berker Peksag in branch '3.4':
Issue #14235: Use importlib.reload() in test_cmd.test_coverage.
http://hg.python.org/cpython/rev/d943089af1c6

New changeset 10a1e7780ee7 by Berker Peksag in branch 'default':
Issue #14235: Merge from 3.4.
http://hg.python.org/cpython/rev/10a1e7780ee7
msg221930 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-06-30 01:08
Fixed. Thanks for the report.
History
Date User Action Args
2014-06-30 01:08:47berker.peksagsetstatus: open -> closed

assignee: eric.araujo -> berker.peksag
versions: + Python 3.4, Python 3.5, - Python 3.2, Python 3.3
nosy: + r.david.murray, berker.peksag

messages: + msg221930
resolution: fixed
stage: resolved
2014-06-30 01:05:52python-devsetnosy: + python-dev
messages: + msg221929
2014-06-28 18:33:09BreamoreBoysetnosy: + BreamoreBoy
messages: + msg221810
2012-03-12 21:59:17eric.araujosetassignee: eric.araujo
messages: + msg155491
versions: + Python 3.2
2012-03-10 05:57:56Josh.Watsonsetmessages: + msg155292
2012-03-10 02:25:39eric.araujosetnosy: + eric.araujo
messages: + msg155282
2012-03-09 01:18:21Josh.Watsonsettype: crash -> behavior
2012-03-09 01:15:37Josh.Watsonsetfiles: + test_cmd-reload.patch
keywords: + patch
messages: + msg155201
2012-03-09 01:12:49Josh.Watsoncreate