classification
Title: Make IDLE calltip tests work when there are no docstrings
Type: behavior Stage: test needed
Components: IDLE Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: terry.reedy
Priority: normal Keywords:

Created on 2020-01-26 08:12 by terry.reedy, last changed 2020-01-26 08:26 by terry.reedy.

Messages (3)
msg360722 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-01-26 08:12
IDLE should run and calltips and tests should work even callables lack docstrings, either because none is defined or because there are suppressed (CPython compile switch for builtins, CPython runtime switch for user objects).  I believe calltips work with or without docstrings present, but:

One User class test is skipped with -OO.  It should be changed to still work.

Multiple builtin tests fail.  #37501 proposes to skip them when compiled without docstrings.  The right long-term solution for IDLE is to change the tests.  My idea is to expand tiptest with 'out' replaced by the signature part, the processed docstring part, and the docstring object.  I want to try something like 

def tiptest(obj, docobj, sig, doc):
    out = sig += doc if docobj.__doc__ is not None else ''
    self.assertEqual(get_spec(obj), out)
msg360723 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-01-26 08:18
In a comment on PR-14592, I noted that other tests fail with -OO; these should be fixed (or skipped?) also.  test_calltips was the only failure with the compile switch.
msg360724 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-01-26 08:26
If test_calltips is fixed before PR-14592 is merged, it should be removed from the latter.
History
Date User Action Args
2020-01-26 08:26:17terry.reedysetmessages: + msg360724
2020-01-26 08:18:53terry.reedysetmessages: + msg360723
2020-01-26 08:12:12terry.reedycreate