Terry J. Reedy added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15392>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to