Commit 1b37e872 authored by Georg Brandl's avatar Georg Brandl

Merged revisions 78093 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line

  Remove unused imports in test modules.
........
parent 7a4f7d92
...@@ -146,7 +146,6 @@ option '-uall,-gui'. ...@@ -146,7 +146,6 @@ option '-uall,-gui'.
""" """
import getopt import getopt
import itertools
import json import json
import os import os
import random import random
...@@ -509,8 +508,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -509,8 +508,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if use_mp: if use_mp:
from threading import Thread from threading import Thread
from queue import Queue, Empty from queue import Queue
from subprocess import Popen, PIPE, STDOUT from subprocess import Popen, PIPE
from collections import deque from collections import deque
debug_output_pat = re.compile(r"\[\d+ refs\]$") debug_output_pat = re.compile(r"\[\d+ refs\]$")
pending = deque() pending = deque()
......
from test.support import verbose, run_unittest from test.support import run_unittest
from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, localeconv, Error) from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, localeconv, Error)
try: try:
from _locale import (RADIXCHAR, THOUSEP, nl_langinfo) from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
......
...@@ -4,7 +4,6 @@ import math ...@@ -4,7 +4,6 @@ import math
import operator import operator
import unittest import unittest
from numbers import Complex, Real, Rational, Integral from numbers import Complex, Real, Rational, Integral
from numbers import Number
from test import support from test import support
class TestNumbers(unittest.TestCase): class TestNumbers(unittest.TestCase):
......
# Python test set -- built-in functions # Python test set -- built-in functions
import platform import platform
import test.support, unittest import unittest
from test.support import fcmp, TESTFN, unlink, run_unittest, \ from test.support import fcmp, TESTFN, unlink, run_unittest
run_with_locale
from operator import neg from operator import neg
import sys, warnings, random, collections, io, fractions import sys, warnings, random, collections, io
warnings.filterwarnings("ignore", "hex../oct.. of negative int", warnings.filterwarnings("ignore", "hex../oct.. of negative int",
FutureWarning, __name__) FutureWarning, __name__)
warnings.filterwarnings("ignore", "integer argument expected", warnings.filterwarnings("ignore", "integer argument expected",
......
from test.support import run_unittest from test.support import run_unittest
from test.test_math import parse_testfile, test_file from test.test_math import parse_testfile, test_file
import unittest import unittest
import os, sys
import cmath, math import cmath, math
from cmath import phase, polar, rect, pi from cmath import phase, polar, rect, pi
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# All tests are executed with environment variables ignored # All tests are executed with environment variables ignored
# See test_cmd_line_script.py for testing of script execution # See test_cmd_line_script.py for testing of script execution
import os
import test.support, unittest import test.support, unittest
import os import os
import sys import sys
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
import unittest import unittest
import os import os
import os.path import os.path
import sys
import test.support import test.support
from test.script_helper import (spawn_python, kill_python, run_python, from test.script_helper import (run_python,
temp_dir, make_script, compile_script, temp_dir, make_script, compile_script,
make_pkg, make_zip_script, make_zip_pkg) make_pkg, make_zip_script, make_zip_pkg)
......
...@@ -7,7 +7,6 @@ from collections import namedtuple, Counter, OrderedDict ...@@ -7,7 +7,6 @@ from collections import namedtuple, Counter, OrderedDict
from test import mapping_tests from test import mapping_tests
import pickle, copy import pickle, copy
from random import randrange, shuffle from random import randrange, shuffle
import operator
import keyword import keyword
import re import re
import sys import sys
......
...@@ -4,9 +4,7 @@ import os ...@@ -4,9 +4,7 @@ import os
import py_compile import py_compile
import shutil import shutil
import struct import struct
import sys
import tempfile import tempfile
import time
from test import support from test import support
import unittest import unittest
......
"""Unit tests for contextlib.py, and other context managers.""" """Unit tests for contextlib.py, and other context managers."""
import sys
import os import os
import decimal
import sys import sys
import tempfile import tempfile
import unittest import unittest
......
...@@ -24,7 +24,6 @@ you're working through IDLE, you can import this test module and call test_main( ...@@ -24,7 +24,6 @@ you're working through IDLE, you can import this test module and call test_main(
with the corresponding argument. with the corresponding argument.
""" """
import glob
import math import math
import os, sys import os, sys
import pickle, copy import pickle, copy
......
...@@ -7,7 +7,6 @@ import copy ...@@ -7,7 +7,6 @@ import copy
import pickle import pickle
from io import StringIO from io import StringIO
import random import random
import os
BIG = 100000 BIG = 100000
......
...@@ -624,7 +624,6 @@ class ClassPropertiesAndMethods(unittest.TestCase): ...@@ -624,7 +624,6 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def test_module_subclasses(self): def test_module_subclasses(self):
# Testing Python subclass of module... # Testing Python subclass of module...
log = [] log = []
import types, sys
MT = type(sys) MT = type(sys)
class MM(MT): class MM(MT):
def __init__(self, name): def __init__(self, name):
...@@ -1006,7 +1005,6 @@ order (MRO) for bases """ ...@@ -1006,7 +1005,6 @@ order (MRO) for bases """
# Test cyclical leaks [SF bug 519621] # Test cyclical leaks [SF bug 519621]
class F(object): class F(object):
__slots__ = ['a', 'b'] __slots__ = ['a', 'b']
log = []
s = F() s = F()
s.a = [Counted(), s] s.a = [Counted(), s]
self.assertEqual(Counted.counter, 1) self.assertEqual(Counted.counter, 1)
...@@ -1015,7 +1013,7 @@ order (MRO) for bases """ ...@@ -1015,7 +1013,7 @@ order (MRO) for bases """
self.assertEqual(Counted.counter, 0) self.assertEqual(Counted.counter, 0)
# Test lookup leaks [SF bug 572567] # Test lookup leaks [SF bug 572567]
import sys,gc import gc
if hasattr(gc, 'get_objects'): if hasattr(gc, 'get_objects'):
class G(object): class G(object):
def __eq__(self, other): def __eq__(self, other):
...@@ -2038,7 +2036,6 @@ order (MRO) for bases """ ...@@ -2038,7 +2036,6 @@ order (MRO) for bases """
## self.assertIn('__self__', dir(a.Amethod)) ## self.assertIn('__self__', dir(a.Amethod))
# Try a module subclass. # Try a module subclass.
import sys
class M(type(sys)): class M(type(sys)):
pass pass
minstance = M("m") minstance = M("m")
...@@ -3206,7 +3203,6 @@ order (MRO) for bases """ ...@@ -3206,7 +3203,6 @@ order (MRO) for bases """
self.fail("d.foo should be undefined now") self.fail("d.foo should be undefined now")
# Test a nasty bug in recurse_down_subclasses() # Test a nasty bug in recurse_down_subclasses()
import gc
class A(object): class A(object):
pass pass
class B(A): class B(A):
...@@ -3996,7 +3992,6 @@ order (MRO) for bases """ ...@@ -3996,7 +3992,6 @@ order (MRO) for bases """
def test_file_fault(self): def test_file_fault(self):
# Testing sys.stdout is changed in getattr... # Testing sys.stdout is changed in getattr...
import sys
test_stdout = sys.stdout test_stdout = sys.stdout
class StdoutGuard: class StdoutGuard:
def __getattr__(self, attr): def __getattr__(self, attr):
...@@ -4087,8 +4082,6 @@ order (MRO) for bases """ ...@@ -4087,8 +4082,6 @@ order (MRO) for bases """
def test_not_implemented(self): def test_not_implemented(self):
# Testing NotImplemented... # Testing NotImplemented...
# all binary methods should be able to return a NotImplemented # all binary methods should be able to return a NotImplemented
import sys
import types
import operator import operator
def specialmethod(self, other): def specialmethod(self, other):
......
...@@ -21,12 +21,10 @@ ...@@ -21,12 +21,10 @@
""" """
Tests for epoll wrapper. Tests for epoll wrapper.
""" """
import os
import socket import socket
import errno import errno
import time import time
import select import select
import tempfile
import unittest import unittest
from test import support from test import support
......
...@@ -7,7 +7,7 @@ from weakref import proxy ...@@ -7,7 +7,7 @@ from weakref import proxy
import io import io
import _pyio as pyio import _pyio as pyio
from test.support import TESTFN, findfile, run_unittest from test.support import TESTFN, run_unittest
from collections import UserList from collections import UserList
class AutoFileTests(unittest.TestCase): class AutoFileTests(unittest.TestCase):
......
import os, filecmp, shutil, tempfile, shutil import os, filecmp, shutil, tempfile
import unittest import unittest
from test import support from test import support
......
...@@ -8,9 +8,7 @@ from array import array ...@@ -8,9 +8,7 @@ from array import array
from weakref import proxy from weakref import proxy
from functools import wraps from functools import wraps
from test.support import (TESTFN, findfile, check_warnings, run_unittest, from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd
make_bad_fd)
from collections import UserList
from _io import FileIO as _FileIO from _io import FileIO as _FileIO
......
...@@ -546,7 +546,6 @@ class IEEEFormatTestCase(unittest.TestCase): ...@@ -546,7 +546,6 @@ class IEEEFormatTestCase(unittest.TestCase):
if float.__getformat__("double").startswith("IEEE"): if float.__getformat__("double").startswith("IEEE"):
def test_negative_zero(self): def test_negative_zero(self):
import math
def pos_pos(): def pos_pos():
return 0.0, math.atan2(0.0, -1) return 0.0, math.atan2(0.0, -1)
def pos_neg(): def pos_neg():
......
"""This test checks for correct fork() behavior. """This test checks for correct fork() behavior.
""" """
import errno
import imp import imp
import os import os
import signal import signal
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
from test.support import captured_stdout, run_unittest from test.support import captured_stdout, run_unittest
import unittest import unittest
import sys, os import sys
class FrozenTests(unittest.TestCase): class FrozenTests(unittest.TestCase):
def test_frozen(self): def test_frozen(self):
......
...@@ -5,7 +5,6 @@ from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard ...@@ -5,7 +5,6 @@ from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest import unittest
import getopt import getopt
import os
sentinel = object() sentinel = object()
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
import array import array
import hashlib import hashlib
from io import StringIO
import itertools import itertools
import sys import sys
try: try:
......
...@@ -370,8 +370,6 @@ class TestErrorHandling(unittest.TestCase): ...@@ -370,8 +370,6 @@ class TestErrorHandling(unittest.TestCase):
def test_main(verbose=None): def test_main(verbose=None):
from types import BuiltinFunctionType
test_classes = [TestHeapPython, TestHeapC, TestErrorHandling] test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
support.run_unittest(*test_classes) support.run_unittest(*test_classes)
......
...@@ -7,10 +7,7 @@ threading = support.import_module('threading') ...@@ -7,10 +7,7 @@ threading = support.import_module('threading')
from contextlib import contextmanager from contextlib import contextmanager
import imaplib import imaplib
import os.path import os.path
import select
import socket
import socketserver import socketserver
import sys
import time import time
from test.support import reap_threads, verbose from test.support import reap_threads, verbose
......
...@@ -6,7 +6,7 @@ import datetime ...@@ -6,7 +6,7 @@ import datetime
import collections import collections
from os.path import normcase from os.path import normcase
from test.support import TESTFN, run_unittest from test.support import run_unittest
from test import inspect_fodder as mod from test import inspect_fodder as mod
from test import inspect_fodder2 as mod2 from test import inspect_fodder2 as mod2
......
...@@ -28,9 +28,8 @@ import random ...@@ -28,9 +28,8 @@ import random
import unittest import unittest
import warnings import warnings
import weakref import weakref
import gc
import abc import abc
from itertools import chain, cycle, count from itertools import cycle, count
from collections import deque from collections import deque
from test import support from test import support
......
...@@ -402,8 +402,6 @@ class LongTest(unittest.TestCase): ...@@ -402,8 +402,6 @@ class LongTest(unittest.TestCase):
self.assertEqual(int(float(x)), y) self.assertEqual(int(float(x)), y)
def test_float_overflow(self): def test_float_overflow(self):
import math
for x in -2.0, -1.0, 0.0, 1.0, 2.0: for x in -2.0, -1.0, 0.0, 1.0, 2.0:
self.assertEqual(float(int(x)), x) self.assertEqual(float(int(x)), x)
...@@ -435,8 +433,6 @@ class LongTest(unittest.TestCase): ...@@ -435,8 +433,6 @@ class LongTest(unittest.TestCase):
"float(shuge) should not equal int(shuge)") "float(shuge) should not equal int(shuge)")
def test_logs(self): def test_logs(self):
import math
LOG10E = math.log10(math.e) LOG10E = math.log10(math.e)
for exp in list(range(10)) + [100, 1000, 10000]: for exp in list(range(10)) + [100, 1000, 10000]:
...@@ -456,7 +452,6 @@ class LongTest(unittest.TestCase): ...@@ -456,7 +452,6 @@ class LongTest(unittest.TestCase):
def test_mixed_compares(self): def test_mixed_compares(self):
eq = self.assertEqual eq = self.assertEqual
import math
# We're mostly concerned with that mixing floats and longs does the # We're mostly concerned with that mixing floats and longs does the
# right stuff, even when longs are too large to fit in a float. # right stuff, even when longs are too large to fit in a float.
......
...@@ -8,7 +8,6 @@ from test import support ...@@ -8,7 +8,6 @@ from test import support
import io import io
import _pyio as pyio import _pyio as pyio
import sys
import pickle import pickle
class MemorySeekTestMixin: class MemorySeekTestMixin:
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# #
from test import support from test import support
from test import test_multibytecodec_support
from test.support import TESTFN from test.support import TESTFN
import unittest, io, codecs, sys, os import unittest, io, codecs, sys, os
import _multibytecodec import _multibytecodec
......
import ntpath import ntpath
import os import os
from test.support import verbose, TestFailed from test.support import TestFailed
from test import support, test_genericpath from test import support, test_genericpath
import unittest import unittest
......
...@@ -16,9 +16,9 @@ from io import StringIO ...@@ -16,9 +16,9 @@ from io import StringIO
from test import support from test import support
from optparse import make_option, Option, IndentedHelpFormatter, \ from optparse import make_option, Option, \
TitledHelpFormatter, OptionParser, OptionContainer, OptionGroup, \ TitledHelpFormatter, OptionParser, OptionGroup, \
SUPPRESS_HELP, SUPPRESS_USAGE, OptionError, OptionConflictError, \ SUPPRESS_USAGE, OptionError, OptionConflictError, \
BadOptionError, OptionValueError, Values BadOptionError, OptionValueError, Values
from optparse import _match_abbrev from optparse import _match_abbrev
from optparse import _parse_num from optparse import _parse_num
...@@ -1224,7 +1224,6 @@ class TestCallbackVarArgs(BaseTest): ...@@ -1224,7 +1224,6 @@ class TestCallbackVarArgs(BaseTest):
def variable_args(self, option, opt, value, parser): def variable_args(self, option, opt, value, parser):
self.assertTrue(value is None) self.assertTrue(value is None)
done = 0
value = [] value = []
rargs = parser.rargs rargs = parser.rargs
while rargs: while rargs:
......
...@@ -154,7 +154,6 @@ class TemporaryFileTests(unittest.TestCase): ...@@ -154,7 +154,6 @@ class TemporaryFileTests(unittest.TestCase):
self.assertTrue(s == "foobar") self.assertTrue(s == "foobar")
def test_tmpnam(self): def test_tmpnam(self):
import sys
if not hasattr(os, "tmpnam"): if not hasattr(os, "tmpnam"):
return return
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning,
...@@ -215,8 +214,6 @@ class StatAttributeTests(unittest.TestCase): ...@@ -215,8 +214,6 @@ class StatAttributeTests(unittest.TestCase):
self.assertEquals(result[stat.ST_SIZE], 3) self.assertEquals(result[stat.ST_SIZE], 3)
self.assertEquals(result.st_size, 3) self.assertEquals(result.st_size, 3)
import sys
# Make sure all the attributes are there # Make sure all the attributes are there
members = dir(result) members = dir(result)
for name in dir(stat): for name in dir(stat):
......
import parser import parser
import os
import unittest import unittest
import sys import sys
import operator import operator
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
# specified test modules (RFE #5142). # specified test modules (RFE #5142).
import imp import imp
import os
import sys import sys
import doctest
import tempfile
from test import support from test import support
# This little helper class is essential for testing pdb under doctest. # This little helper class is essential for testing pdb under doctest.
......
...@@ -8,7 +8,6 @@ from __future__ import print_function ...@@ -8,7 +8,6 @@ from __future__ import print_function
import unittest import unittest
from test import support from test import support
import sys
try: try:
# 3.x # 3.x
from io import StringIO from io import StringIO
......
"""Test suite for the profile module.""" """Test suite for the profile module."""
import os
import sys import sys
import pstats import pstats
import unittest import unittest
......
...@@ -5,7 +5,6 @@ from io import BytesIO ...@@ -5,7 +5,6 @@ from io import BytesIO
import sys import sys
import unittest import unittest
import pyexpat
from xml.parsers import expat from xml.parsers import expat
from test.support import sortdict, run_unittest from test.support import sortdict, run_unittest
......
# Some simple queue module tests, plus some failure conditions # Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable. # to ensure the Queue locks remain stable.
import queue import queue
import sys
import threading import threading
import time import time
import unittest import unittest
......
...@@ -5,7 +5,7 @@ import random ...@@ -5,7 +5,7 @@ import random
import time import time
import pickle import pickle
import warnings import warnings
from math import log, exp, sqrt, pi, fsum, sin from math import log, exp, pi, fsum, sin
from test import support from test import support
class TestBasicOps(unittest.TestCase): class TestBasicOps(unittest.TestCase):
......
from test.support import verbose, run_unittest from test.support import verbose, run_unittest
import re import re
from re import Scanner from re import Scanner
import sys, os, traceback import sys, traceback
from weakref import proxy from weakref import proxy
# Misc tests from Tim Peters' re.doc # Misc tests from Tim Peters' re.doc
...@@ -748,7 +748,7 @@ class ReTests(unittest.TestCase): ...@@ -748,7 +748,7 @@ class ReTests(unittest.TestCase):
self.assertRaises(TypeError, _sre.compile, {}, 0, []) self.assertRaises(TypeError, _sre.compile, {}, 0, [])
def run_re_tests(): def run_re_tests():
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
if verbose: if verbose:
print('Running re_tests test suite') print('Running re_tests test suite')
else: else:
......
...@@ -5,7 +5,6 @@ import weakref ...@@ -5,7 +5,6 @@ import weakref
import operator import operator
import copy import copy
import pickle import pickle
import os
from random import randrange, shuffle from random import randrange, shuffle
import sys import sys
import warnings import warnings
......
...@@ -3,7 +3,6 @@ Test suite for socketserver. ...@@ -3,7 +3,6 @@ Test suite for socketserver.
""" """
import contextlib import contextlib
import errno
import imp import imp
import os import os
import select import select
...@@ -11,13 +10,11 @@ import signal ...@@ -11,13 +10,11 @@ import signal
import socket import socket
import tempfile import tempfile
import threading import threading
import time
import unittest import unittest
import socketserver import socketserver
import test.support import test.support
from test.support import reap_children, reap_threads, verbose from test.support import reap_children, reap_threads, verbose
from test.support import TESTFN as TEST_FILE
test.support.requires("network") test.support.requires("network")
......
import unittest
from test.support import run_unittest, import_module from test.support import run_unittest, import_module
# Skip test if _sqlite3 module not installed # Skip test if _sqlite3 module not installed
......
...@@ -5,13 +5,10 @@ import unittest ...@@ -5,13 +5,10 @@ import unittest
from test import support from test import support
import socket import socket
import select import select
import errno
import subprocess
import time import time
import os import os
import pprint import pprint
import urllib.parse, urllib.request import urllib.parse, urllib.request
import shutil
import traceback import traceback
import asyncore import asyncore
......
...@@ -4,7 +4,6 @@ Unittest for time.strftime ...@@ -4,7 +4,6 @@ Unittest for time.strftime
import calendar import calendar
import sys import sys
import os
import re import re
from test import support from test import support
import time import time
......
...@@ -6,7 +6,7 @@ from _testcapi import test_structmembersType, \ ...@@ -6,7 +6,7 @@ from _testcapi import test_structmembersType, \
LLONG_MAX, LLONG_MIN, ULLONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX, \
PY_SSIZE_T_MAX, PY_SSIZE_T_MIN PY_SSIZE_T_MAX, PY_SSIZE_T_MIN
import warnings, unittest, sys import unittest
from test import support from test import support
ts=test_structmembersType(False, # T_BOOL ts=test_structmembersType(False, # T_BOOL
......
...@@ -461,7 +461,7 @@ class SysModuleTest(unittest.TestCase): ...@@ -461,7 +461,7 @@ class SysModuleTest(unittest.TestCase):
sys._clear_type_cache() sys._clear_type_cache()
def test_ioencoding(self): def test_ioencoding(self):
import subprocess,os import subprocess
env = dict(os.environ) env = dict(os.environ)
# Test character: cent sign, encoded as 0x4A (ASCII J) in CP424, # Test character: cent sign, encoded as 0x4A (ASCII J) in CP424,
......
...@@ -6,7 +6,6 @@ executing have not been removed. ...@@ -6,7 +6,6 @@ executing have not been removed.
""" """
import unittest import unittest
import sys import sys
import test
import os import os
import subprocess import subprocess
import shutil import shutil
......
...@@ -2,7 +2,6 @@ import sys ...@@ -2,7 +2,6 @@ import sys
import os import os
import io import io
import shutil import shutil
import tempfile
import io import io
from hashlib import md5 from hashlib import md5
import errno import errno
......
...@@ -3,7 +3,6 @@ import tempfile ...@@ -3,7 +3,6 @@ import tempfile
import os import os
import sys import sys
import re import re
import errno
import warnings import warnings
import unittest import unittest
......
import os import os
import sys
import unittest import unittest
from test import support from test import support
......
import os import os
import sys
from test import support from test import support
# Skip this test if _tkinter does not exist. # Skip this test if _tkinter does not exist.
......
...@@ -18,7 +18,6 @@ class TypesTests(unittest.TestCase): ...@@ -18,7 +18,6 @@ class TypesTests(unittest.TestCase):
if not {'x': 1}: self.fail('{\'x\': 1} is false instead of true') if not {'x': 1}: self.fail('{\'x\': 1} is false instead of true')
def f(): pass def f(): pass
class C: pass class C: pass
import sys
x = C() x = C()
if not f: self.fail('f is false instead of true') if not f: self.fail('f is false instead of true')
if not C: self.fail('C is false instead of true') if not C: self.fail('C is false instead of true')
......
...@@ -6,7 +6,6 @@ from test.test_urllib2 import sanepathname2url ...@@ -6,7 +6,6 @@ from test.test_urllib2 import sanepathname2url
import os import os
import socket import socket
import sys
import urllib.error import urllib.error
import urllib.request import urllib.request
...@@ -75,8 +74,6 @@ class AuthTests(unittest.TestCase): ...@@ -75,8 +74,6 @@ class AuthTests(unittest.TestCase):
class CloseSocketTest(unittest.TestCase): class CloseSocketTest(unittest.TestCase):
def test_close(self): def test_close(self):
import socket, http.client, gc
# calling .close() on urllib2's response objects should close the # calling .close() on urllib2's response objects should close the
# underlying socket # underlying socket
...@@ -150,7 +147,6 @@ class OtherNetworkTests(unittest.TestCase): ...@@ -150,7 +147,6 @@ class OtherNetworkTests(unittest.TestCase):
## self._test_urls(urls, self._extra_handlers()+[bauth, dauth]) ## self._test_urls(urls, self._extra_handlers()+[bauth, dauth])
def _test_urls(self, urls, handlers, retry=True): def _test_urls(self, urls, handlers, retry=True):
import socket
import time import time
import logging import logging
debug = logging.getLogger("test_urllib2").debug debug = logging.getLogger("test_urllib2").debug
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# for working with modules located inside zipfiles # for working with modules located inside zipfiles
# The tests are centralised in this fashion to make it easy to drop them # The tests are centralised in this fashion to make it easy to drop them
# if a platform doesn't support zipimport # if a platform doesn't support zipimport
import unittest
import test.support import test.support
import os import os
import os.path import os.path
...@@ -15,8 +14,7 @@ import inspect ...@@ -15,8 +14,7 @@ import inspect
import linecache import linecache
import pdb import pdb
from test.script_helper import (spawn_python, kill_python, run_python, from test.script_helper import (spawn_python, kill_python, run_python,
temp_dir, make_script, compile_script, temp_dir, make_script, make_zip_script)
make_pkg, make_zip_script, make_zip_pkg)
verbose = test.support.verbose verbose = test.support.verbose
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment