# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. import os import pickle import random import subprocess import sys import textwrap import time import unittest from test import support from test.support import MISSING_C_DOCSTRINGS from test.support.script_helper import assert_python_failure try: import _posixsubprocess except ImportError: _posixsubprocess = None try: import threading except ImportError: threading = None # Skip this test if the _testcapi module isn't available. _testcapi = support.import_module('_testcapi') # Were we compiled --with-pydebug or with #define Py_DEBUG? Py_DEBUG = hasattr(sys, 'gettotalrefcount') class SubinterpreterTest(unittest.TestCase): def test_subinterps(self): code = "import _pickle" ret = support.run_in_subinterp(code) self.assertEqual(ret, 0) if __name__ == "__main__": unittest.main()