Skip to content

Commit 04af2d3

Browse files
author
Anselm Kruis
committed
added test for TaskletExit
1 parent e02caa4 commit 04af2d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stackless_testsuite/v3_1/testContent.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import unittest
2222
import types
23+
import __builtin__
2324

2425
from stackless_testsuite import stackless_api
2526
from stackless_testsuite.util import FUNCTION, create_type_tests_for_module
@@ -69,6 +70,15 @@ def testAdditionalNames(self):
6970
missing.add(name)
7071
self.assertFalse(missing, "Missing names {}".format(missing))
7172

73+
def testTaskletExit(self):
74+
# TaskletExit is special, as it is defined in __builtin__
75+
try:
76+
te = __builtin__.TaskletExit
77+
except AttributeError:
78+
self.fail("__builtin__ does not contain TaskletExit")
79+
# Stackless Documentation says so
80+
self.assertTrue(issubclass(te, SystemExit), "TaskletExit is not a subclass of SystemExit")
81+
7282
# create the remaining tests dynamically
7383
create_type_tests_for_module(locals(), stackless, DECLARED_API, ADDITIONAL_API)
7484

0 commit comments

Comments
 (0)