Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc module is enabled.
(code)
| 2024 | |
| 2025 | |
| 2026 | def run_in_subinterp(code): |
| 2027 | """ |
| 2028 | Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc |
| 2029 | module is enabled. |
| 2030 | """ |
| 2031 | _check_tracemalloc() |
| 2032 | try: |
| 2033 | import _testcapi |
| 2034 | except ImportError: |
| 2035 | raise unittest.SkipTest("requires _testcapi") |
| 2036 | return _testcapi.run_in_subinterp(code) |
| 2037 | |
| 2038 | |
| 2039 | def run_in_subinterp_with_config(code, *, own_gil=None, **config): |
no test coverage detected
searching dependent graphs…