mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	bpo-40443: Remove unused imports in tests (GH-19805)
This commit is contained in:
		
							parent
							
								
									69e802ed81
								
							
						
					
					
						commit
						57572b103e
					
				
					 17 changed files with 4 additions and 20 deletions
				
			
		|  | @ -8,7 +8,6 @@ | |||
| import unittest | ||||
| import operator | ||||
| import struct | ||||
| import sys | ||||
| from test import support | ||||
| from test.support.script_helper import assert_python_failure | ||||
| from test.support.script_helper import assert_python_ok | ||||
|  |  | |||
|  | @ -1,9 +1,6 @@ | |||
| import ast | ||||
| import os | ||||
| import sys | ||||
| import _peg_parser as peg_parser | ||||
| import unittest | ||||
| from pathlib import PurePath | ||||
| from typing import Any, Union, Iterable, Tuple | ||||
| from textwrap import dedent | ||||
| from test import support | ||||
|  |  | |||
|  | @ -3,7 +3,6 @@ | |||
| import subprocess | ||||
| import sys | ||||
| import unittest | ||||
| import collections | ||||
| from unittest import mock | ||||
| 
 | ||||
| from test import support | ||||
|  |  | |||
|  | @ -3,7 +3,6 @@ | |||
| import dis | ||||
| import pickle | ||||
| import unittest | ||||
| import sys | ||||
| 
 | ||||
| from test.support import check_syntax_error, use_old_parser | ||||
| 
 | ||||
|  |  | |||
|  | @ -5,7 +5,6 @@ | |||
| from pstats import SortKey | ||||
| 
 | ||||
| import pstats | ||||
| import time | ||||
| import cProfile | ||||
| 
 | ||||
| class AddCallersTestCase(unittest.TestCase): | ||||
|  |  | |||
|  | @ -2217,7 +2217,7 @@ def test_re_benchmarks(self): | |||
| 
 | ||||
|     def test_re_tests(self): | ||||
|         're_tests test suite' | ||||
|         from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR | ||||
|         from test.re_tests import tests, FAIL, SYNTAX_ERROR | ||||
|         for t in tests: | ||||
|             pattern = s = outcome = repl = expected = None | ||||
|             if len(t) == 5: | ||||
|  |  | |||
|  | @ -5,7 +5,6 @@ | |||
| """ | ||||
| 
 | ||||
| import contextlib | ||||
| import faulthandler | ||||
| import glob | ||||
| import io | ||||
| import os.path | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ | |||
| import tempfile | ||||
| import unittest | ||||
| import warnings | ||||
| from test.support import check_syntax_warning, use_old_parser | ||||
| from test.support import use_old_parser | ||||
| 
 | ||||
| 
 | ||||
| TEMPLATE = r"""# coding: %s | ||||
|  |  | |||
|  | @ -1,4 +1,3 @@ | |||
| import contextlib | ||||
| import errno | ||||
| import importlib | ||||
| import io | ||||
|  |  | |||
|  | @ -644,7 +644,6 @@ | |||
| """ | ||||
| 
 | ||||
| import re | ||||
| import sys | ||||
| import unittest | ||||
| 
 | ||||
| from test import support | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ | |||
| import io | ||||
| import os | ||||
| import pathlib | ||||
| import signal | ||||
| import sys | ||||
| import re | ||||
| import warnings | ||||
|  |  | |||
|  | @ -1,4 +1,3 @@ | |||
| import itertools | ||||
| import textwrap | ||||
| import unittest | ||||
| import sys | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| """Tests for the lll script in the Tools/script directory.""" | ||||
| 
 | ||||
| import os | ||||
| import sys | ||||
| import tempfile | ||||
| from test import support | ||||
| from test.test_tools import skip_if_missing, import_tool | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| import sys | ||||
| import unittest | ||||
| from test import support | ||||
| from test.test_tools import import_tool, scriptsdir, skip_if_missing | ||||
| from test.test_tools import scriptsdir, skip_if_missing | ||||
| 
 | ||||
| 
 | ||||
| # need Tools/script/ directory: skip if run on Python installed on the system | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| import pickle | ||||
| import re | ||||
| import sys | ||||
| from unittest import TestCase, main, skipUnless, SkipTest, skip | ||||
| from unittest import TestCase, main, skipUnless, skip | ||||
| from copy import copy, deepcopy | ||||
| 
 | ||||
| from typing import Any, NoReturn | ||||
|  |  | |||
|  | @ -6,7 +6,6 @@ | |||
| import random | ||||
| import tokenize | ||||
| import ast | ||||
| import sys | ||||
| 
 | ||||
| 
 | ||||
| def read_pyfile(filename): | ||||
|  |  | |||
|  | @ -6,8 +6,6 @@ | |||
| import io | ||||
| import os | ||||
| import pickle | ||||
| import shutil | ||||
| import subprocess | ||||
| import sys | ||||
| import weakref | ||||
| from unittest import mock | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner