(self)
| 2328 | self.assertEqual(text.strip(), "<Token.MISSING>") |
| 2329 | |
| 2330 | def test_is_running(self): |
| 2331 | def check(interpid, expected): |
| 2332 | with self.assertRaisesRegex(InterpreterError, 'unrecognized'): |
| 2333 | _interpreters.is_running(interpid, restrict=True) |
| 2334 | running = _interpreters.is_running(interpid) |
| 2335 | self.assertIs(running, expected) |
| 2336 | |
| 2337 | with self.subTest('from _interpreters (running)'): |
| 2338 | interpid = _interpreters.create() |
| 2339 | with self.running(interpid): |
| 2340 | running = _interpreters.is_running(interpid) |
| 2341 | self.assertTrue(running) |
| 2342 | |
| 2343 | with self.subTest('from _interpreters (not running)'): |
| 2344 | interpid = _interpreters.create() |
| 2345 | running = _interpreters.is_running(interpid) |
| 2346 | self.assertFalse(running) |
| 2347 | |
| 2348 | with self.subTest('main'): |
| 2349 | interpid, *_ = _interpreters.get_main() |
| 2350 | check(interpid, True) |
| 2351 | |
| 2352 | with self.subTest('from C-API (running __main__)'): |
| 2353 | with self.interpreter_from_capi() as interpid: |
| 2354 | with self.running_from_capi(interpid, main=True): |
| 2355 | check(interpid, True) |
| 2356 | |
| 2357 | with self.subTest('from C-API (running, but not __main__)'): |
| 2358 | with self.interpreter_from_capi() as interpid: |
| 2359 | with self.running_from_capi(interpid, main=False): |
| 2360 | check(interpid, False) |
| 2361 | |
| 2362 | with self.subTest('from C-API (not running)'): |
| 2363 | with self.interpreter_from_capi() as interpid: |
| 2364 | check(interpid, False) |
| 2365 | |
| 2366 | def test_exec(self): |
| 2367 | with self.subTest('run script'): |
nothing calls this directly
no test coverage detected