[wingide-users] Python Mocker gives different result inside WingIDE

Erkan Özgür Yılmaz eoyilmaz at gmail.com
Wed Oct 20 16:34:32 MDT 2010


Hi,

Long time lurker is posting his first question :)

ok, lets start:

i'm trying to run the example code in the Python Mocker documentation and
got different results if I run the code in Python Shell inside WingIDE and
run it in a Python shell which is started in linux terminal.

Here is the code and the result in WingIDEs Python Shell:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3]
Type "help", "copyright", "credits" or "license" for more information.
>>> import mocker
>>> mockerObj = mocker.Mocker()
>>> obj = mockerObj.mock()
>>> obj.hello()
<mocker.Mock object at 0x2797390>
>>> mockerObj.result('Hi')
>>> mockerObj.replay()
>>> obj.hello()
<mocker.Mock object at 0x279a8d0>


And the same in the linux shell:
ozgur at HDX-Linux:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mocker
>>> mockerObj = mocker.Mocker()
>>> obj = mockerObj.mock()
>>> obj.hello()
<mocker.Mock object at 0x22b92d0>
>>> mockerObj.result('Hi!')
>>> mockerObj.replay()
>>> obj.hello()
'Hi!'

the difference is the result of calling "obj.hello()" at the last line gives
<mocker.Mock object at 0x279a8d0> in WingIDEs Python Shell and simply 'Hi!'
(this is what I expect to have in WingIDE too) in linux shell.

could it be related with environment variables? (though I don't see anything
weird, I've only added a path to the Python path variable in project
settings which is not related with Mocker )
or is it related with an option I forgot to choose?

I'm using:
WingIDE Professional 3.2.11-1 (rev 22974)
Kubuntu 10.04LTS 64bit
uname -r gives 2.6.32-25-generic
and as seen in code snippets I'm using Python 2.6


E.Ozgur Yilmaz
Lead Technical Director
eoyilmaz.blogspot.com
www.ozgurfx.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20101021/87eeb82d/attachment.html


More information about the wingide-users mailing list