derwiki-adroll / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Mock instance cannot return itself #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

>>> import mock
>>> m = mock.Mock()
>>> m.return_value = m
>>> m() is m

What is the expected output? What do you see instead?

It should output True, instead it fills the memory and fails with a MemoryError

What version of the product are you using? On what operating system?

mock==dev (0.8.0beta3)

Original issue reported on code.google.com by bertrand.croq@gmail.com on 4 Oct 2011 at 9:36

GoogleCodeExporter commented 9 years ago
Ouch! Thanks for finding this.

Original comment by fuzzyman on 4 Oct 2011 at 10:55

GoogleCodeExporter commented 9 years ago
This is now fixed on head, although I'd appreciate you trying it out. I also 
fixed a couple of related issues with "circular references" of mocks. I'll do a 
new (and hopefully final) beta release shortly.

Original comment by fuzzyman on 7 Oct 2011 at 1:55

GoogleCodeExporter commented 9 years ago
I have tried with Mock 0.8.0beta4 and there is no problem.
Thanks for this quick fix.

Original comment by bertrand.croq@gmail.com on 10 Oct 2011 at 1:08