MCPcopy
hub / github.com/MagicStack/asyncpg / run_in_subinterpreter

Method run_in_subinterpreter

tests/test_subinterpreters.py:19–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 class TestSubinterpreters(unittest.TestCase):
18 def test_record_module_loads_in_subinterpreter(self) -> None:
19 def run_in_subinterpreter() -> None:
20 interp = interpreters.create()
21
22 try:
23 code = textwrap.dedent("""\
24 import asyncpg.protocol.record as record
25 assert record.Record is not None
26 """)
27 interp.exec(code)
28 finally:
29 interp.close()
30
31 thread = threading.Thread(target=run_in_subinterpreter)
32 thread.start()

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected