gh-76785: Consolidate Some Interpreter-related Testing Helpers (gh-117485)

This eliminates the duplication of functionally identical helpers in the _testinternalcapi and _xxsubinterpreters modules.
This commit is contained in:
Eric Snow 2024-04-02 17:16:50 -06:00 committed by GitHub
parent f341d6017d
commit 857d3151c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 527 additions and 313 deletions

View file

@ -584,7 +584,7 @@ class RunStringTests(TestBase):
def test_create_daemon_thread(self):
with self.subTest('isolated'):
expected = 'spam spam spam spam spam'
subinterp = interpreters.create(isolated=True)
subinterp = interpreters.create('isolated')
script, file = _captured_script(f"""
import threading
def f():
@ -604,7 +604,7 @@ class RunStringTests(TestBase):
self.assertEqual(out, expected)
with self.subTest('not isolated'):
subinterp = interpreters.create(isolated=False)
subinterp = interpreters.create('legacy')
script, file = _captured_script("""
import threading
def f():