summaryrefslogtreecommitdiffstats
path: root/tests/test_subtype.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-07-26 08:46:07 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-07-26 08:46:07 +0000
commit7079b546e06dd77b61cd1ba4692a077a85b9e033 (patch)
treeb505c4318cc8b5c7eed6251e0a008de42e0113e7 /tests/test_subtype.py
parentb94d79214498b07abc22e676897c8314cc386c7c (diff)
downloadpygobject-7079b546e06dd77b61cd1ba4692a077a85b9e033.tar.gz
pygobject-7079b546e06dd77b61cd1ba4692a077a85b9e033.tar.xz
pygobject-7079b546e06dd77b61cd1ba4692a077a85b9e033.zip
Run pyflakes on the testsuite, remove unused imports and reorganize
2008-07-26 Johan Dahlin <johan@gnome.org> * tests/common.py: * tests/test_conversion.py: * tests/test_enum.py: * tests/test_interface.py: * tests/test_option.py: * tests/test_source.py: * tests/test_subprocess.py: * tests/test_subtype.py: * tests/test_thread.py: * tests/test_unknown.py: Run pyflakes on the testsuite, remove unused imports and reorganize others. svn path=/trunk/; revision=859
Diffstat (limited to 'tests/test_subtype.py')
-rw-r--r--tests/test_subtype.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_subtype.py b/tests/test_subtype.py
index a77ea4e..b74c4ff 100644
--- a/tests/test_subtype.py
+++ b/tests/test_subtype.py
@@ -1,29 +1,32 @@
import unittest
import weakref
import gc
-import sys
import testmodule
from common import gobject, testhelper
-from gobject import GObject, GInterface, GObjectMeta
+
+# FIXME: do not import gtk
import gtk
-class _ClassInittableMetaType(GObjectMeta):
+
+class _ClassInittableMetaType(gobject.GObjectMeta):
def __init__(cls, name, bases, namespace):
super(_ClassInittableMetaType, cls).__init__(name, bases, namespace)
cls.__class_init__(namespace)
+
class ClassInittableObject(object):
__metaclass__ = _ClassInittableMetaType
def __class_init__(cls, namespace):
pass
__class_init__ = classmethod(__class_init__)
+
class TestSubType(unittest.TestCase):
def testSubType(self):
- t = type('testtype', (GObject, GInterface), {})
- self.failUnless(issubclass(t, GObject))
- self.failUnless(issubclass(t, GInterface))
+ t = type('testtype', (gobject.GObject, gobject.GInterface), {})
+ self.failUnless(issubclass(t, gobject.GObject))
+ self.failUnless(issubclass(t, gobject.GInterface))
def testGObject(self):
label = gobject.GObject()
@@ -230,7 +233,7 @@ class TestSubType(unittest.TestCase):
disposed_calls = []
def on_dispose():
disposed_calls.append(None)
- gobj = GObject()
+ gobj = gobject.GObject()
gobj.set_data('tmp', CallInDel(on_dispose))
del gobj
assert len(disposed_calls) == 1