diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-07-14 17:31:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-14 17:31:12 (GMT) |
commit | 8b7db5a1114e2113a756bdf8877fbe366055c69a (patch) | |
tree | 99c1e0d6845c172d4ec499afceec6a5e0a20291d /Lib/test/test_import | |
parent | 1c5e68e7145f0825f9b952389141edb9436eb43d (diff) | |
download | cpython-8b7db5a1114e2113a756bdf8877fbe366055c69a.zip cpython-8b7db5a1114e2113a756bdf8877fbe366055c69a.tar.gz cpython-8b7db5a1114e2113a756bdf8877fbe366055c69a.tar.bz2 |
bpo-37473: Don't import importlib ASAP in tests (GH-14661)
bpo-15386, bpo-37473: test_import, regrtest and libregrtest no longer
import importlib as soon as possible, as the first import, "to test
bpo-15386".
It is tested by test_import.test_there_can_be_only_one().
Sort test_import imports.
Diffstat (limited to 'Lib/test/test_import')
-rw-r--r-- | Lib/test/test_import/__init__.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 50406d9..88746b4 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -1,24 +1,22 @@ -# We import importlib *ASAP* in order to test #15386 -import importlib +import builtins +import contextlib +import errno +import glob import importlib.util from importlib._bootstrap_external import _get_sourcefile -import builtins import marshal import os import py_compile import random import shutil -import subprocess import stat +import subprocess import sys +import textwrap import threading import time import unittest -import unittest.mock as mock -import textwrap -import errno -import contextlib -import glob +from unittest import mock import test.support from test.support import ( |