classification
Title: test_readline fails when readline was installed after running configure (and was not re-run)
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: r.david.murray Nosy List: nessita, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2011-03-14 14:33 by nessita, last changed 2011-03-14 21:15 by r.david.murray. This issue is now closed.

Files
File name Uploaded Description Edit
pycon-issue11496.patch nessita, 2011-03-14 14:50 review
pycon-issue11496.patch nessita, 2011-03-14 15:47 review
Messages (8)
msg130817 - (view) Author: Natalia B. Bidart (nessita) * Date: 2011-03-14 14:33
If libreadline-dev was installed after configure was run, and the latter is not re-run, test_readline fails with:

[1/1] test_readline
test test_readline failed -- Traceback (most recent call last):
  File "/home/nessita/pycon/sprint/cpython/Lib/test/test_readline.py", line 16, in testHistoryUpdates
    readline.clear_history()
AttributeError: 'module' object has no attribute 'clear_history'

1 test failed:
    test_readline
msg130819 - (view) Author: Natalia B. Bidart (nessita) * Date: 2011-03-14 14:37
I'm working on a patch.
msg130823 - (view) Author: Natalia B. Bidart (nessita) * Date: 2011-03-14 14:50
Trivial patch to skip the test if module 'readline' doesn't have the 'clear_history' attr.
msg130826 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-03-14 15:18
Hmm.  It seems to me that in this case the test *should* fail, since it indicates a broken Python installation.  How about instead catching the error in the test and calling self.fail with the error and an additional message about making sure configure has been run?
msg130827 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-03-14 15:29
MvL explained that there is a configure tests that makes the existence of this routine optional.  So the skip is appropriate, but the message should read something like "the clear history tests cannot be run because the clear_history method is not available.

Martin also points out that this method has been available for a long time, so it may perhaps be appropriate to remove the configure test and turn this back in to a failure.  But that would be a separate issue if someone cares to pursue it.
msg130833 - (view) Author: Natalia B. Bidart (nessita) * Date: 2011-03-14 15:47
Attaching patch with improved skip message as per David's comment.
msg130900 - (view) Author: Roundup Robot (python-dev) Date: 2011-03-14 21:14
New changeset a89d654adaa2 by R David Murray in branch '3.2':
#11496: skip history test if clear_history is not available.
http://hg.python.org/cpython/rev/a89d654adaa2

New changeset ecc176488349 by R David Murray in branch 'default':
Merge #11496 from 3.2.
http://hg.python.org/cpython/rev/ecc176488349
msg130901 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-03-14 21:15
Thanks.
History
Date User Action Args
2011-04-29 22:42:51ned.deilylinkissue11206 superseder
2011-03-14 21:15:56r.david.murraysetstatus: open -> closed

type: crash -> behavior
versions: + Python 3.2
nosy: r.david.murray, nessita, python-dev
messages: + msg130901
resolution: fixed
stage: resolved
2011-03-14 21:14:50python-devsetnosy: + python-dev
messages: + msg130900
2011-03-14 18:12:02r.david.murraysetassignee: r.david.murray
nosy: r.david.murray, nessita
2011-03-14 15:47:45nessitasetfiles: + pycon-issue11496.patch
nosy: r.david.murray, nessita
messages: + msg130833
2011-03-14 15:29:00r.david.murraysetnosy: r.david.murray, nessita
messages: + msg130827
2011-03-14 15:18:45r.david.murraysetnosy: + r.david.murray
messages: + msg130826
2011-03-14 14:50:42nessitasetfiles: + pycon-issue11496.patch

messages: + msg130823
keywords: + patch
2011-03-14 14:37:28nessitasetmessages: + msg130819
2011-03-14 14:33:13nessitacreate