summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-11-12 03:46:08 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2013-11-12 03:46:56 -0800
commit8342302dac9bf3fcb49ec3ac334dbf014b4db025 (patch)
tree37e549d5465cea1621b7e072d3b99a9f17173d4e
parent1f37340c4623262a2146ec8cd25b487cdf4234bd (diff)
downloadpygobject-8342302dac9bf3fcb49ec3ac334dbf014b4db025.tar.gz
Revert "Add type checking to positional Gtk.Box and Gtk.Window ctor arguments"
This reverts commit 7193f0509a0ed7da7c810daa6733e34a22db3180.
-rw-r--r--gi/overrides/Gtk.py7
-rw-r--r--tests/test_overrides_gtk.py18
-rw-r--r--tests/test_properties.py9
3 files changed, 0 insertions, 34 deletions
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 9f084923..e774c0c2 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -330,10 +330,6 @@ __all__.append('ComboBox')
class Box(Gtk.Box):
def __init__(self, homogeneous=False, spacing=0, **kwds):
- if not isinstance(homogeneous, bool):
- raise TypeError('homogeneous argument must be of type bool')
- if not isinstance(spacing, int):
- raise TypeError('spacing argument must be of type int')
super(Box, self).__init__(**kwds)
self.set_homogeneous(homogeneous)
self.set_spacing(spacing)
@@ -440,9 +436,6 @@ class Window(Gtk.Window):
if not initialized:
raise RuntimeError("Gtk couldn't be initialized")
- if not isinstance(type, Gtk.WindowType):
- raise TypeError('type argument must be of type Gtk.WindowType')
-
# type is a construct-only property; if it is already set (e. g. by
# GtkBuilder), do not try to set it again and just ignore it
try:
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 145f0f90..fefc9a85 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -590,24 +590,6 @@ class TestGtk(unittest.TestCase):
GLib.timeout_add(100, Gtk.main_quit, 'hello')
Gtk.main()
- def test_gobject_ctor_positional_args(self):
- # GObject constructor must only allow keyword args, except for the ones
- # which have overrides
-
- # overridden, but no custom constructor
- self.assertRaises(TypeError, Gtk.Widget, 1)
- self.assertRaises(TypeError, Gtk.Container, 1)
-
- # no overrides at all
- self.assertRaises(TypeError, Gtk.FileChooserWidget,
- Gtk.FileChooserAction.SELECT_FOLDER)
- self.assertRaises(TypeError, Gtk.Assistant, 1)
-
- def test_gobject_ctor_unknown_property(self):
- # GObject constructor must refuse unknown properties
- self.assertRaises(TypeError, Gtk.Widget, unknown_prop=1)
- self.assertRaises(TypeError, Gtk.Button, unknown_prop='a')
-
@unittest.skipUnless(Gtk, 'Gtk not available')
class TestSignals(unittest.TestCase):
diff --git a/tests/test_properties.py b/tests/test_properties.py
index ec9ddf13..ef6b8674 100644
--- a/tests/test_properties.py
+++ b/tests/test_properties.py
@@ -481,15 +481,6 @@ class TestPropertyObject(unittest.TestCase):
self.assertEqual(normal, "foo")
self.assertEqual(uint64, 7)
- def test_positional_args(self):
- # GObject constructor must only allow keyword args
- self.assertRaises(TypeError, new, PropertyObject, None)
- self.assertRaises(TypeError, new, PropertyObject, "hello", 2)
-
- def test_unknown_constructor_property(self):
- # GObject constructor must refuse unknown properties
- self.assertRaises(TypeError, new, PropertyObject, unknown_prop=1)
-
class TestProperty(unittest.TestCase):
def test_simple(self):