Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc module is enabled.
(code)
| 1950 | |
| 1951 | |
| 1952 | def run_in_subinterp(code): |
| 1953 | """ |
| 1954 | Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc |
| 1955 | module is enabled. |
| 1956 | """ |
| 1957 | _check_tracemalloc() |
| 1958 | try: |
| 1959 | import _testcapi |
| 1960 | except ImportError: |
| 1961 | raise unittest.SkipTest("requires _testcapi") |
| 1962 | return _testcapi.run_in_subinterp(code) |
| 1963 | |
| 1964 | |
| 1965 | def run_in_subinterp_with_config(code, *, own_gil=None, **config): |
no test coverage detected