Skip to content

Commit 9336630

Browse files
committed
Better test
1 parent 6a17c55 commit 9336630

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/test/test_concurrent_futures/test_interpreter_pool.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,10 @@ def test_free_reference(self):
463463
def test_import_interpreter_pool_executor(self):
464464
# Test the import behavior normally if _interpreters is unavailable.
465465
code = textwrap.dedent(f"""
466-
from concurrent import futures
467466
import sys
468467
# Set it to None to emulate the case when _interpreter is unavailable.
469-
futures._interpreters = None
468+
sys.modules['_interpreters'] = None
469+
from concurrent import futures
470470
471471
try:
472472
futures.InterpreterPoolExecutor
@@ -483,6 +483,8 @@ def test_import_interpreter_pool_executor(self):
483483
else:
484484
print('ImportError not raised!', file=sys.stderr)
485485
sys.exit(1)
486+
487+
from concurrent.futures import *
486488
""")
487489

488490
cmd = [sys.executable, '-c', code]

0 commit comments

Comments
 (0)