diff options
| author | Jason Madden <jamadden@gmail.com> | 2020-11-12 11:49:12 -0600 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2020-11-12 11:49:12 -0600 |
| commit | 8448b094d1b81788ac9cbaf86a184712f1daf5e0 (patch) | |
| tree | 34e07251b520b94f44fd40136687bb059a08e256 /src/greenlet/tests/test_cpp.py | |
| parent | c80fab93073603289f41df8e32b7ecc25f37763e (diff) | |
| download | greenlet-issue184.tar.gz | |
Move to the src/ layout, and make greenlet a package.issue184
Make 'tests' become 'greenlet.tests', and be compatible with 'python -m unittest discover'.
Fixes #184. Fixes #184. Fixes #189.
Diffstat (limited to 'src/greenlet/tests/test_cpp.py')
| -rw-r--r-- | src/greenlet/tests/test_cpp.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/greenlet/tests/test_cpp.py b/src/greenlet/tests/test_cpp.py new file mode 100644 index 0000000..741ea10 --- /dev/null +++ b/src/greenlet/tests/test_cpp.py @@ -0,0 +1,18 @@ +from __future__ import print_function +from __future__ import absolute_import + +import unittest + +import greenlet +from . 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) |
