]> granicus.if.org Git - python/commitdiff
Issue #20043: Add direct test for _thread.
authorTerry Jan Reedy <tjreedy@udel.edu>
Fri, 13 Jun 2014 18:23:43 +0000 (14:23 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Fri, 13 Jun 2014 18:23:43 +0000 (14:23 -0400)
Lib/test/test_multiprocessing_main_handling.py

index 7ea8e7806c725363970d8ba117fe282d0b4d8c7d..bfd67378a5f143060a7b9d4e4f37dc4e01342d66 100644 (file)
@@ -1,4 +1,8 @@
 # tests __main__ module handling in multiprocessing
+from test import support
+# Skip tests if _thread or _multiprocessing wasn't built.
+support.import_module('_thread')
+support.import_module('_multiprocessing')
 
 import importlib
 import importlib.machinery
@@ -9,14 +13,11 @@ import os
 import os.path
 import py_compile
 
-from test import support
 from test.script_helper import (
     make_pkg, make_script, make_zip_pkg, make_zip_script,
     assert_python_ok, assert_python_failure, temp_dir,
     spawn_python, kill_python)
 
-# Skip tests if _multiprocessing wasn't built.
-_multiprocessing = support.import_module('_multiprocessing')
 # Look up which start methods are available to test
 import multiprocessing
 AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods())