MCPcopy Index your code
hub / github.com/python/cpython / test_subinterpreter

Method test_subinterpreter

Lib/test/test_interpreters/test_api.py:197–207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

195 self.assertEqual(current, main)
196
197 def test_subinterpreter(self):
198 main = interpreters.get_main()
199 interp = interpreters.create()
200 out = _run_output(interp, dedent("""
201 from concurrent import interpreters
202 cur = interpreters.get_current()
203 print(cur.id)
204 """))
205 current = interpreters.Interpreter(int(out))
206 self.assertEqual(current, interp)
207 self.assertNotEqual(current, main)
208
209 def test_idempotent(self):
210 with self.subTest('main'):

Callers

nothing calls this directly

Calls 5

dedentFunction · 0.90
assertNotEqualMethod · 0.80
_run_outputFunction · 0.70
createMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected