summaryrefslogtreecommitdiff
path: root/tests/test_cpp.py
blob: ad1888fd31677988612b7eb967c08e4a59354c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import unittest

import greenlet
import _test_extension_cpp


class CPPTests(unittest.TestCase):
    def test_exception_switch(self):
        greenlets = []
        for i in range(4):
            g = greenlet.greenlet(_test_extension_cpp.test_exception_switch)
            g.switch(i)
            greenlets.append(g)
        for i, g in enumerate(greenlets):
            self.assertEqual(g.switch(), i)