Skip to content

Commit 2359c6b

Browse files
author
Anselm Kruis
committed
Add method StacklessTestCase.skipIfSoftswitching()
It is the counterpart to the already existing method skipUnlessSoftswitching()
1 parent c839ac2 commit 2359c6b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

stackless_testsuite/util.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,16 @@ def skipUnlessSoftswitching(self):
113113
def enable_softswitch(x):
114114
return False
115115
if not enable_softswitch(None):
116-
self.skipTest("test requires softswitching")
116+
self.skipTest("test requires soft-switching")
117+
118+
def skipIfSoftswitching(self):
119+
try:
120+
enable_softswitch = stackless.enable_softswitch
121+
except AttributeError:
122+
def enable_softswitch(x):
123+
return False
124+
if enable_softswitch(None):
125+
self.skipTest("test requires hard-switching")
117126

118127
def assertCallableWith0Args(self, func, additionalArg=None):
119128
self.assertRaisesRegex(TypeError, r"takes no arguments|expected 0 arguments", func, additionalArg)

0 commit comments

Comments
 (0)