Commits

Anonymous committed e501ded

8 errors.

  • Participants
  • Parent commits cb763b0

Comments (0)

Files changed (2)

tests/test_hierarchy.py

         assert(test.compound_id == None)
 
     def test_repeating_id(self):
-        test = twc.RepeatingWidget(id='x', child=twc.Widget)
+        test = twc.RepeatingWidget(id='x', child=twc.Widget())
         assert(test.rwbc[3].compound_id == 'x:3')
 
     #--
     # Repeating Widget Bunch
     #--
     def test_rwb(self):
-        test = twc.RepeatingWidget(child=twc.Widget)
+        test = twc.RepeatingWidget(child=twc.Widget())
         testapi.request(1)
         test.value = ['a', 'b', 'c']
         test.prepare()
         assert(test.children[0] is not test.children[1])
 
     def test_rw_propagate(self):
-        test = twc.RepeatingWidget(child=twc.Widget)
+        test = twc.RepeatingWidget(child=twc.Widget())
         testapi.request(1)
         test.value = ['a', 'b', 'c']
         test.prepare()
         assert([w.value for w in test.children] == ['a', 'b', 'c'])
 
     def test_rw_length(self):
-        testb = twc.RepeatingWidget(child=twc.Widget)
+        testb = twc.RepeatingWidget(child=twc.Widget())
 
         test = testb
         test.repetitions = None

tw2/core/widgets.py

             self.child = self.child.__class__(children = self.children)
             self.children = []
         if not isinstance(self.child, Widget):
-            raise pm.ParameterError("Child must be a Widget")
+            raise pm.ParameterError("Child must be a Widget, not %s", self.child)
         if getattr(self.child, 'id', None):
             raise pm.ParameterError("Child must have no id")
         self.child.parent = self