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: test_pydoc fails with -S
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: pitrou, python-dev, serhiy.storchaka, terry.reedy, vajrasky
Priority: low Keywords: patch

Created on 2013-10-25 19:43 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_test_pydoc_with_S_flag.patch vajrasky, 2013-10-26 11:07 review
fix_test_pydoc_with_S_flag_v2.patch vajrasky, 2013-10-26 15:54 review
Messages (6)
msg201285 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-25 19:43
$ ./python -S -m test test_pydoc
[1/1] test_pydoc
test test_pydoc failed -- Traceback (most recent call last):
  File "/home/antoine/cpython/default/Lib/test/test_pydoc.py", line 473, in test_namedtuple_public_underscore
    help(NT)
NameError: name 'help' is not defined
msg201337 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-10-26 11:07
Attached the patch to fix the test.

The main issue is that with S flag, we do not have "help" in builtins. And I think that is deliberate.

[sky@localhost cpython]$ ./python -S
Python 3.4.0a4+ (default:64fb6a58ebf4+, Oct 26 2013, 19:04:01) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
>>> 
[sky@localhost cpython]$ ./python 
Python 3.4.0a4+ (default:64fb6a58ebf4+, Oct 26 2013, 19:04:01) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
msg201341 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-10-26 12:35
Just use pydoc.help.
msg201370 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-10-26 15:54
Attached the patch based on Serhiy's suggestion.
msg202185 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-05 02:43
New changeset 2c191b0b5e7a by Terry Jan Reedy in branch '3.3':
Issue #19397: test_pydoc now works with -S (help not added to builtins).
http://hg.python.org/cpython/rev/2c191b0b5e7a
msg202186 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-05 02:45
New changeset 92022b45e60b by Terry Jan Reedy in branch '2.7':
Issue #19397: test_pydoc now works with -S (help not added to builtins).
http://hg.python.org/cpython/rev/92022b45e60b
History
Date User Action Args
2022-04-11 14:57:52adminsetgithub: 63596
2013-11-05 02:48:43terry.reedysetstatus: open -> closed
stage: resolved
resolution: fixed
versions: + Python 2.7
2013-11-05 02:45:50python-devsetmessages: + msg202186
2013-11-05 02:43:40python-devsetnosy: + python-dev
messages: + msg202185
2013-11-05 02:27:26terry.reedysetassignee: terry.reedy

nosy: + terry.reedy
2013-10-26 15:54:11vajraskysetfiles: + fix_test_pydoc_with_S_flag_v2.patch

messages: + msg201370
2013-10-26 12:35:51serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg201341
2013-10-26 11:07:13vajraskysetfiles: + fix_test_pydoc_with_S_flag.patch

nosy: + vajrasky
messages: + msg201337

keywords: + patch
2013-10-25 19:43:23pitroucreate