Commits

David Schneider committed 877a6de

cleanup

  • Participants
  • Parent commits a8fb049

Comments (0)

Files changed (1)

 import py
 import r
 
+
 def test_class():
     class Test(r.RPyObject):
         x = r.attribute(int)
     py.test.raises(r.RPythonTypeError, "t.y = 1")
     py.test.raises(r.RPythonTypeError, "t.y = 'abc'")
 
+
 def test_subclass():
     class Test(r.RPyObject):
         x = r.attribute(int)
     assert s.x == 2
     assert s.y == 2.3
 
+
 def test_class_referencing_class():
     class A(r.RPyObject):
         x = r.attribute(int)
+
     class ASub(A):
         y = r.attribute(float)
+
     class B(r.RPyObject):
         a = r.attribute(A)
 
     b.a.y = 1.2
     assert b.a.y == 1.2
 
+
 def test_class_and_none():
     class A(r.RPyObject):
         x = r.attribute(int)
+
     class B(r.RPyObject):
         a = r.attribute(A)
 
     b.a = None
     assert b.a is None
 
+
 def test_default_value():
     class A(r.RPyObject):
         x = r.attribute(int, default_value=41)
     a = A()
     assert a.x == 41
 
+
 def test_immutable_attribute():
     class A(r.RPyObject):
         x = r.immutable_attribute(int)
     assert a.x == 31
     py.test.raises(r.RPythonTypeError, "a.x = 1")
 
+
 def test_rpy_tuple():
+    ttyp = r.get_rpy_type((int, int))
+    assert r.get_rpy_type((int, int)) is ttyp
+    ttyp.type_check((1, 2))
+    py.test.raises(r.RPythonTypeError, ttyp.type_check, (1, "abc"))
 
 
 def test_rpy_mixed_tuple():
     assert r.get_rpy_type((int, float)) is ttyp
     ttyp.type_check((1, 2.0))
     py.test.raises(r.RPythonTypeError, ttyp.type_check, (1, "abc"))
-    ttyp = r.get_rpy_type((int, int))
-    assert r.get_rpy_type((int, int)) is ttyp
-    ttyp.type_check((1, 2))
-    py.test.raises(r.RPythonTypeError, ttyp.type_check, (1, "abc"))