You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
Create a file foo.py containing the following class definitions:
import abc
class Foo(object):
__metaclass__ = abc.ABCMeta
class Bar(Foo):
pass
Now execute the following:
import foo
import mox
mox.Mox().StubOutClassWithMocks(foo, 'Foo')
What is the expected output?
StubOutClassWithMocks() should not produce any errors.
What do you see instead?
Raises "TypeError: Given attr is not a Class. Use StubOutWithMock."
Reason: type(foo.Foo) is <class 'abc.ABCMeta'>, which doesn't fall into any of
the categories in _USE_MOCK_FACTORY.
Original issue reported on code.google.com by openvcd...@gmail.com on 12 Apr 2012 at 11:53
The text was updated successfully, but these errors were encountered:
I'm attaching a diff against trunk to add support for this. Please apply and
pull in to our internal version. Thanks! :)
We need this for Python 2.7 support as things being mocked in some code such as
gzip.GZipFile inherit from a <class 'abc.ABCMeta'> base class.
Original comment by g...@google.com on 15 Aug 2012 at 11:26
Original issue reported on code.google.com by
openvcd...@gmail.com
on 12 Apr 2012 at 11:53The text was updated successfully, but these errors were encountered: