Closed GoogleCodeExporter closed 9 years ago
This reproduces the problem:
=== mymodule.py ===
class MyClass(object):
pass
=== reproduce.py ===
import mox
import mymodule
class Test(object):
def __init__(self):
self.mox = mox.Mox()
self.mox.StubOutWithMock(mymodule, 'MyClass', use_mock_anything=True)
self.mox.CreateMock(mymodule.MyClass)
Test()
I don't know if this is CPython changing its behaviour to be closer to spec and
pymox depending on CPython implementation details. I'm hoping someone else can
clear this up.
Original comment by soren@linux2go.dk
on 2 Jun 2011 at 9:01
It might be worth keeping an eye on http://bugs.python.org/issue12248 (original
issue filed here: https://bugs.launchpad.net/python/+bug/791221).
Original comment by daniel.h...@googlemail.com
on 3 Jun 2011 at 4:52
Everyone weighing in on that bug on bugs.python.org seems to agree that the
strict type checking should be done away with. However, the change itself
(calling __dir__ for old-style classes) seems like it's going to stay, so pymox
will need fixing regardless. This is because pymox isn't just returning the
wrong sort of list-like object, but rather a MockMethod.
Original comment by soren@linux2go.dk
on 6 Jun 2011 at 8:34
I'm applying this patch in Ubuntu to stop being blocked on this issue. If you
choose a different approach to addressing this issue, I will of course follow
suit.
Original comment by soren@linux2go.dk
on 6 Jun 2011 at 9:12
Attachments:
Fixed with r63. Thanks for the patch.
Original comment by stev...@google.com
on 6 Jun 2011 at 6:44
Original issue reported on code.google.com by
zul...@gmail.com
on 2 Jun 2011 at 7:35