blob: 9eddc88ff9d2d92f81e1f165dd81d64e52cd1ebe [file] [log] [blame]
Tim Petersd66595f2001-02-04 03:09:53 +00001# Run the _testcapi module tests (tests for the Python/C API): by defn,
2# these are all functions _test exports whose name begins with 'test_'.
Tim Peters9ea17ac2001-02-02 05:57:15 +00003
4import sys
5import test_support
Tim Petersd66595f2001-02-04 03:09:53 +00006import _testcapi
Tim Peters9ea17ac2001-02-02 05:57:15 +00007
Tim Petersd66595f2001-02-04 03:09:53 +00008for name in dir(_testcapi):
Tim Peters9ea17ac2001-02-02 05:57:15 +00009 if name.startswith('test_'):
Tim Petersd66595f2001-02-04 03:09:53 +000010 test = getattr(_testcapi, name)
Tim Peters9ea17ac2001-02-02 05:57:15 +000011 if test_support.verbose:
12 print "internal", name
13 try:
14 test()
Tim Petersd66595f2001-02-04 03:09:53 +000015 except _testcapi.error:
Tim Peters9ea17ac2001-02-02 05:57:15 +000016 raise test_support.TestFailed, sys.exc_info()[1]