[wingide-users] Debug probe and Mocker test tools seems to clash
Xavier Masson
xmasson at assemblee-nationale.fr
Tue Mar 9 07:53:22 MST 2010
Hello all.
I may be wrong or missing something obvious but it seems to me than the
python shell in Wing is interacting in a weird way with the mocker library.
I know mock libraries tend to do weird things with the python namespace
so .... :)
To reproduce the bug just dowload the mocker library
(http://labix.org/mocker) in a virtualenv
> easy_install mocker
Then start wing in the virtualenv and in the python shell :
>>>from mocker import Mocker
>>>mocker=Mocker()
>>>obj=mocker.mock()
>>>obj.hello()
>>>mocker.result('hi')
>>mocker.replay()
>>> obj.hello()
<mocker.Mock object at 0x00F99A90>
instead of
hi
A more complex example :
>>>from mocker import Mocker
>>>mocker=Mocker()
>>>obj=mocker.mock()
>>>len(obj.attr.method("param"))
0
>>>mocker.result(15)
>>mocker.replay()
>>len(obj.attr.method("param"))
>><mocker.Mock object at 0x00F99A90>
instead of 15
Doing the same in iPython or on the python command line work fine ...
Thanks a lot for your help.
________________________________________________________________
Ce message, ainsi que les pièces jointes, sont établis, sous la
seule responsabilité de l'expéditeur, à l'intention exclusive
de ses destinataires ; ils peuvent contenir des informations
confidentielles. Toute publication, utilisation ou diffusion
doit être autorisée préalablement.
Ce message a fait l'objet d'un traitement anti-virus.
Il est rappelé que tout message électronique est susceptible
d'altération au cours de son acheminement sur Internet.
________________________________________________________________
Vous pouvez consulter le site de l'Assemblée nationale à
l'adresse suivante : http://www.assemblee-nationale.fr
More information about the wingide-users
mailing list