Skip to content

Commit 87acef9

Browse files
committed
allow skipping tests in test runner with skip:SUITE.TEST
1 parent 72e1ce8 commit 87acef9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/runner.py

+14
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class RunnerCore(unittest.TestCase):
7878
stderr_redirect = STDOUT # This avoids cluttering the test runner output, which is stderr too, with compiler warnings etc.
7979
# Change this to None to get stderr reporting, for debugging purposes
8080

81+
def skipme(self): # used by tests we ask on the commandline to be skipped, see right before call to unittest.main
82+
return self.skip('requested to be skipped')
83+
8184
def setUp(self):
8285
global Settings
8386
Settings.reset()
@@ -10187,6 +10190,17 @@ def test_relooper(self):
1018710190
elif len(JS_ENGINES) < total_engines:
1018810191
print 'WARNING: Not all the JS engines in JS_ENGINES appears to work, ignoring those.'
1018910192

10193+
# Skip requested tests
10194+
10195+
for i in range(len(sys.argv)):
10196+
arg = sys.argv[i]
10197+
if arg.startswith('skip:'):
10198+
which = arg.split('skip:')[1]
10199+
print >> sys.stderr, 'will skip "%s"' % which
10200+
exec(which + ' = RunnerCore.skipme')
10201+
sys.argv[i] = ''
10202+
sys.argv = filter(lambda arg: arg, sys.argv)
10203+
1019010204
# Go
1019110205

1019210206
unittest.main()

0 commit comments

Comments
 (0)