Message189275
For future reference, there is an idle specific issue that I do not think has been mentioned yet. Idle can run in one process, but the default mode now, and perhaps only mode sometime in the future, is two processes communicating through a socket. Testing two process communication requires two test processes, not just one. Tests will pass in one process without testing the full normal process. For instance:
def fetch_tip(self, expression):
try:
rpcclt = self.editwin.flist.pyshell.interp.rpcclt
except AttributeError:
rpcclt = None
if rpcclt:
return rpcclt.remotecall("exec", "get_the_calltip",
(expression,), {})
else:
return get_argspec(get_entity(expression))
I believe this works because fetch_tip executed in the idle process makes a remote call that results in fetch_tip being executed in the remote process, where self has no editwin and hence control falls through to the last line.
A normal, naive test of fetch_tip will 'work' because it will simply fall through to the last line, which in this case is mostly redundant with separate tests of get_entity and get_argspec. It seems to me that a full test suite must at some point test that the actual communication works, and that this cannot all be done with mocks. |
|
Date |
User |
Action |
Args |
2013-05-15 08:10:30 | terry.reedy | set | recipients:
+ terry.reedy, ncoghlan, ned.deily, ezio.melotti, roger.serwy, r.david.murray, Todd.Rovito, tshepang, francismb, JayKrish, Tomoki.Imai |
2013-05-15 08:10:30 | terry.reedy | set | messageid: <1368605430.04.0.303776876065.issue15392@psf.upfronthosting.co.za> |
2013-05-15 08:10:30 | terry.reedy | link | issue15392 messages |
2013-05-15 08:10:29 | terry.reedy | create | |
|