Commits

Ronny Pfannschmidt committed 798c063

add a test for the exception state information

Comments (0)

Files changed (1)

tests/test_greenlet.py

         self.assertTrue(error != None, "greenlet.error was not raised!")
         done_event.set()
         thread.join()
+
+
+    def test_exc_state(self):
+        def f():
+            try:
+                raise ValueError('fun')
+            except:
+                exc_info = sys.exc_info()
+                greenlet(h).switch()
+                self.assertEqual(exc_info, sys.exc_info())
+
+        def h():
+            self.assertEqual(sys.exc_info(), (None, None, None))
+
+        greenlet(f).switch()