Skip to content

Instantly share code, notes, and snippets.

@gsmcwhirter
Created January 14, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsmcwhirter/518ab85f5cb64cea951e to your computer and use it in GitHub Desktop.
Save gsmcwhirter/518ab85f5cb64cea951e to your computer and use it in GitHub Desktop.
import pyglet.text as pygtext
class BaseObject(object):
pass
class Stuff(BaseObject, pygtext.Label):
pass
from mock import Mock
import sys
MOCKS = {
'pyglet.text': Mock(['Label'])
}
sys.modules.update((mod_name, mod_val) for mod_name, mod_val in MOCKS.items())
import source #see below -- errors about not being able to handle the multiple inheritance
#Traceback (most recent call last):
# File "tests.py", line 11, in <module>
# import source #see below -- errors about not being able to handle the multiple inheritance
# File "/Users/gsmcwhirter/Sources/wwgamelib/tests/source.py", line 6, in <module>
# class Stuff(BaseObject, pygtext.Label):
#TypeError: Error when calling the metaclass bases
# metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment