Commits

danjac  committed ebdec97

teardown tests

  • Participants
  • Parent commits 00855a4
  • Branches alfajor-integration

Comments (0)

Files changed (1)

File tests/__init__.py

     except AttributeError:
         pass
 
+value = 5
+
+increments = testing.register_module()
+
+@increments.setup
+def increment():
+    global value
+    value += 1
+
+@increments.teardown
+def decrement():
+    global value
+    value -= 2
+
+@increments.with_context
+def test_is_higher():
+
+    print value, "higher?"
+    assert value == 6
+
+@increments.with_context
+def test_is_lower():
+    
+    print value, "lower?"
+    assert value == 5
+
+
 class TestSetup(TestCase):
 
     def create_app(self):