Closed GoogleCodeExporter closed 9 years ago
Can you be more specific (example code that shows the problem). I can create
and use two mocks with the same name without problem:
{{{
>>> from mock import Mock
>>> m = Mock(name='foo')
>>> m2 = Mock(name='foo')
>>> m()
<mock.Mock object at 0x50ae70>
>>> m2()
<mock.Mock object at 0x50a890>
}}}
I'm afraid I don't know what you mean by "in a different compilation unit". Do
you mean in different python modules? I can do that without problem as well:
{{{
$ echo "from mock import Mock
> m = Mock(name='foo')" > one.py
$ cp one.py two.py
$ python
Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from one import m as m1
>>> from two import m as m2
>>> m1()
<mock.Mock object at 0x50aa70>
>>> m2()
<mock.Mock object at 0x50a890>
}}}
Original comment by fuzzyman
on 14 Jul 2011 at 10:54
This is embarrassing. I thought this was the issues list for Google mock to be
used as part of the Google test suite.
Thanks anyway for the quick reply.
Original comment by kie...@koding.co.uk
on 14 Jul 2011 at 12:29
Hah. You'll have many fewer problems if you switch to "mock". ;-)
Original comment by fuzzyman
on 14 Jul 2011 at 12:31
Original issue reported on code.google.com by
kie...@koding.co.uk
on 14 Jul 2011 at 10:48