Commits

Anonymous committed 668eb51 Draft

Small rearrangement in test_signature for clarity

Comments (0)

Files changed (1)

pypy/rlib/test/test_signature.py

 from pypy.translator.translator import TranslationContext, graphof
 
 
-def test_signature_bookkeeping():
-    @signature('x', 'y', returns='z')
-    def f(a, b):
-        return a + len(b)
-    f.foo = 'foo'
-    assert f._signature_ == (('x', 'y'), 'z')
-    assert f.func_name == 'f'
-    assert f.foo == 'foo'
-    assert f(1, 'hello') == 6
-
 def annotate_at(f):
     t = TranslationContext()
     a = t.buildannotator()
     exc = py.test.raises(Exception, annotate_at, caller).value
     assert caller.func_name in repr(exc.args)
 
+
+def test_signature_bookkeeping():
+    @signature('x', 'y', returns='z')
+    def f(a, b):
+        return a + len(b)
+    f.foo = 'foo'
+    assert f._signature_ == (('x', 'y'), 'z')
+    assert f.func_name == 'f'
+    assert f.foo == 'foo'
+    assert f(1, 'hello') == 6
+
 def test_signature_basic():
     @signature(types.int(), types.str(), returns=types.char())
     def f(a, b):