mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Remove unused imports in test modules.
This commit is contained in:
		
							parent
							
								
									dc3694bee0
								
							
						
					
					
						commit
						a4f46e1292
					
				
					 74 changed files with 40 additions and 135 deletions
				
			
		| 
						 | 
					@ -149,7 +149,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import cStringIO
 | 
					import cStringIO
 | 
				
			||||||
import getopt
 | 
					import getopt
 | 
				
			||||||
import itertools
 | 
					 | 
				
			||||||
import json
 | 
					import json
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import random
 | 
					import random
 | 
				
			||||||
| 
						 | 
					@ -448,8 +447,8 @@ def test_forever(tests=list(tests)):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
from test.test_support import verbose, run_unittest
 | 
					from test.test_support import run_unittest
 | 
				
			||||||
from _locale import (setlocale, LC_NUMERIC, localeconv, Error)
 | 
					from _locale import (setlocale, LC_NUMERIC, localeconv, Error)
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
    from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
 | 
					    from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,10 +1,8 @@
 | 
				
			||||||
"""Unit tests for numbers.py."""
 | 
					"""Unit tests for numbers.py."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import math
 | 
					import math
 | 
				
			||||||
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 test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestNumbers(unittest.TestCase):
 | 
					class TestNumbers(unittest.TestCase):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,9 +7,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MacOS = test_support.import_module('MacOS')
 | 
					MacOS = test_support.import_module('MacOS')
 | 
				
			||||||
# The following should exist if MacOS does.
 | 
					# The following should exist if MacOS does.
 | 
				
			||||||
import macostools
 | 
					 | 
				
			||||||
import applesingle
 | 
					import applesingle
 | 
				
			||||||
import Carbon.File
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
AS_MAGIC=0x00051600
 | 
					AS_MAGIC=0x00051600
 | 
				
			||||||
AS_VERSION=0x00020000
 | 
					AS_VERSION=0x00020000
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
   Adapted to unittest format and expanded scope by Raymond Hettinger
 | 
					   Adapted to unittest format and expanded scope by Raymond Hettinger
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
import os, sys
 | 
					import os, sys
 | 
				
			||||||
import copy
 | 
					 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,12 @@
 | 
				
			||||||
# Python test set -- built-in functions
 | 
					# Python test set -- built-in functions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import platform
 | 
					import platform
 | 
				
			||||||
import test.test_support, unittest
 | 
					import unittest
 | 
				
			||||||
from test.test_support import fcmp, have_unicode, TESTFN, unlink, \
 | 
					from test.test_support import fcmp, have_unicode, TESTFN, unlink, \
 | 
				
			||||||
                              run_unittest, run_with_locale
 | 
					                              run_unittest
 | 
				
			||||||
from operator import neg
 | 
					from operator import neg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import sys, warnings, cStringIO, random, fractions, UserDict
 | 
					import sys, warnings, cStringIO, random, UserDict
 | 
				
			||||||
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",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
from test.test_support import run_unittest
 | 
					from test.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 @@
 | 
				
			||||||
# 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.test_support, unittest
 | 
					import test.test_support, unittest
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
from test.script_helper import spawn_python, kill_python, python_exit_code
 | 
					from test.script_helper import spawn_python, kill_python, python_exit_code
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,9 +3,8 @@
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import os.path
 | 
					import os.path
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
import test.test_support
 | 
					import test.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)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,6 @@
 | 
				
			||||||
from test import mapping_tests
 | 
					from test import mapping_tests
 | 
				
			||||||
import pickle, cPickle, copy
 | 
					import pickle, cPickle, copy
 | 
				
			||||||
from random import randrange, shuffle
 | 
					from random import randrange, shuffle
 | 
				
			||||||
import operator
 | 
					 | 
				
			||||||
import keyword
 | 
					import keyword
 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
from collections import Hashable, Iterable, Iterator
 | 
					from collections import Hashable, Iterable, Iterator
 | 
				
			||||||
| 
						 | 
					@ -848,7 +847,7 @@ def test_popitem(self):
 | 
				
			||||||
        d = self._empty_mapping()
 | 
					        d = self._empty_mapping()
 | 
				
			||||||
        self.assertRaises(KeyError, d.popitem)
 | 
					        self.assertRaises(KeyError, d.popitem)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import doctest, collections
 | 
					import collections
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_main(verbose=None):
 | 
					def test_main(verbose=None):
 | 
				
			||||||
    NamedTupleDocs = doctest.DocTestSuite(module=collections)
 | 
					    NamedTupleDocs = doctest.DocTestSuite(module=collections)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,8 +12,7 @@
 | 
				
			||||||
from test.test_support import run_unittest, reap_children, import_module
 | 
					from test.test_support import run_unittest, reap_children, import_module
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Silence Py3k warning
 | 
					# Silence Py3k warning
 | 
				
			||||||
import_module('commands', deprecated=True)
 | 
					commands = import_module('commands', deprecated=True)
 | 
				
			||||||
from commands import *
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The module says:
 | 
					# The module says:
 | 
				
			||||||
#   "NB This only works (and is only relevant) for UNIX."
 | 
					#   "NB This only works (and is only relevant) for UNIX."
 | 
				
			||||||
| 
						 | 
					@ -28,8 +27,8 @@
 | 
				
			||||||
class CommandTests(unittest.TestCase):
 | 
					class CommandTests(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_getoutput(self):
 | 
					    def test_getoutput(self):
 | 
				
			||||||
        self.assertEquals(getoutput('echo xyzzy'), 'xyzzy')
 | 
					        self.assertEquals(commands.getoutput('echo xyzzy'), 'xyzzy')
 | 
				
			||||||
        self.assertEquals(getstatusoutput('echo xyzzy'), (0, 'xyzzy'))
 | 
					        self.assertEquals(commands.getstatusoutput('echo xyzzy'), (0, 'xyzzy'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # we use mkdtemp in the next line to create an empty directory
 | 
					        # we use mkdtemp in the next line to create an empty directory
 | 
				
			||||||
        # under our exclusive control; from that, we can invent a pathname
 | 
					        # under our exclusive control; from that, we can invent a pathname
 | 
				
			||||||
| 
						 | 
					@ -39,7 +38,7 @@ def test_getoutput(self):
 | 
				
			||||||
            dir = tempfile.mkdtemp()
 | 
					            dir = tempfile.mkdtemp()
 | 
				
			||||||
            name = os.path.join(dir, "foo")
 | 
					            name = os.path.join(dir, "foo")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            status, output = getstatusoutput('cat ' + name)
 | 
					            status, output = commands.getstatusoutput('cat ' + name)
 | 
				
			||||||
            self.assertNotEquals(status, 0)
 | 
					            self.assertNotEquals(status, 0)
 | 
				
			||||||
        finally:
 | 
					        finally:
 | 
				
			||||||
            if dir is not None:
 | 
					            if dir is not None:
 | 
				
			||||||
| 
						 | 
					@ -60,7 +59,7 @@ def test_getstatus(self):
 | 
				
			||||||
                  /\.          # and end with the name of the file.
 | 
					                  /\.          # and end with the name of the file.
 | 
				
			||||||
               '''
 | 
					               '''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.assertTrue(re.match(pat, getstatus("/."), re.VERBOSE))
 | 
					        self.assertTrue(re.match(pat, commands.getstatus("/."), re.VERBOSE))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_main():
 | 
					def test_main():
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,9 +4,7 @@
 | 
				
			||||||
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 test_support
 | 
					from test import test_support
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
"""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 tempfile
 | 
					import tempfile
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
| 
						 | 
					@ -147,7 +145,6 @@ def b():
 | 
				
			||||||
            self.fail("Didn't raise ZeroDivisionError")
 | 
					            self.fail("Didn't raise ZeroDivisionError")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_nested_right_exception(self):
 | 
					    def test_nested_right_exception(self):
 | 
				
			||||||
        state = []
 | 
					 | 
				
			||||||
        @contextmanager
 | 
					        @contextmanager
 | 
				
			||||||
        def a():
 | 
					        def a():
 | 
				
			||||||
            yield 1
 | 
					            yield 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1722,7 +1722,6 @@ def test_session_cookies(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_main(verbose=None):
 | 
					def test_main(verbose=None):
 | 
				
			||||||
    from test import test_sets
 | 
					 | 
				
			||||||
    test_support.run_unittest(
 | 
					    test_support.run_unittest(
 | 
				
			||||||
        DateTimeTests,
 | 
					        DateTimeTests,
 | 
				
			||||||
        HeaderTests,
 | 
					        HeaderTests,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
import copy
 | 
					import copy
 | 
				
			||||||
import copy_reg
 | 
					import copy_reg
 | 
				
			||||||
import weakref
 | 
					import weakref
 | 
				
			||||||
import operator
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,6 @@
 | 
				
			||||||
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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,6 @@
 | 
				
			||||||
import copy
 | 
					import copy
 | 
				
			||||||
import cPickle as pickle
 | 
					import cPickle as pickle
 | 
				
			||||||
import random
 | 
					import random
 | 
				
			||||||
import os
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
BIG = 100000
 | 
					BIG = 100000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -261,7 +261,6 @@ def __add__(self, other):
 | 
				
			||||||
            pass
 | 
					            pass
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.fail("NotImplemented should have caused TypeError")
 | 
					            self.fail("NotImplemented should have caused TypeError")
 | 
				
			||||||
        import sys
 | 
					 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            C(sys.maxint+1)
 | 
					            C(sys.maxint+1)
 | 
				
			||||||
        except OverflowError:
 | 
					        except OverflowError:
 | 
				
			||||||
| 
						 | 
					@ -654,7 +653,6 @@ class D(B, C):
 | 
				
			||||||
    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):
 | 
				
			||||||
| 
						 | 
					@ -1131,7 +1129,6 @@ class E(D):
 | 
				
			||||||
        # 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)
 | 
				
			||||||
| 
						 | 
					@ -1140,7 +1137,7 @@ class F(object):
 | 
				
			||||||
        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 __cmp__(self, other):
 | 
					                def __cmp__(self, other):
 | 
				
			||||||
| 
						 | 
					@ -1945,7 +1942,6 @@ def __str__(self):
 | 
				
			||||||
                    return 'EPS'
 | 
					                    return 'EPS'
 | 
				
			||||||
                return self
 | 
					                return self
 | 
				
			||||||
        # sys.stdout needs to be the original to trigger the recursion bug
 | 
					        # sys.stdout needs to be the original to trigger the recursion bug
 | 
				
			||||||
        import sys
 | 
					 | 
				
			||||||
        test_stdout = sys.stdout
 | 
					        test_stdout = sys.stdout
 | 
				
			||||||
        sys.stdout = test_support.get_original_stdout()
 | 
					        sys.stdout = test_support.get_original_stdout()
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
| 
						 | 
					@ -2309,7 +2305,6 @@ def Amethod(self): pass
 | 
				
			||||||
        self.assertIn('im_self', dir(a.Amethod))
 | 
					        self.assertIn('im_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")
 | 
				
			||||||
| 
						 | 
					@ -3506,7 +3501,6 @@ def __getattr__(self, name):
 | 
				
			||||||
            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):
 | 
				
			||||||
| 
						 | 
					@ -4327,7 +4321,6 @@ def test_wrapper_segfault(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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):
 | 
				
			||||||
| 
						 | 
					@ -4416,8 +4409,6 @@ def test_method_wrapper(self):
 | 
				
			||||||
    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):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test.test_support import run_unittest, TESTFN, import_module
 | 
					from test.test_support import run_unittest, import_module
 | 
				
			||||||
dircache = import_module('dircache', deprecated=True)
 | 
					dircache = import_module('dircache', deprecated=True)
 | 
				
			||||||
import os, time, sys, tempfile
 | 
					import os, time, sys, tempfile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,6 @@
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import socket
 | 
					import socket
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import xmlrpclib
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
PORT = None
 | 
					PORT = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 test_support
 | 
					from test import test_support
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,7 @@
 | 
				
			||||||
import io
 | 
					import io
 | 
				
			||||||
import _pyio as pyio
 | 
					import _pyio as pyio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test.test_support import TESTFN, findfile, run_unittest
 | 
					from test.test_support import TESTFN, run_unittest
 | 
				
			||||||
from UserList import UserList
 | 
					from UserList import UserList
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AutoFileTests(unittest.TestCase):
 | 
					class AutoFileTests(unittest.TestCase):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
from weakref import proxy
 | 
					from weakref import proxy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
from test.test_support import TESTFN, findfile, run_unittest
 | 
					from test.test_support import TESTFN, run_unittest
 | 
				
			||||||
from UserList import UserList
 | 
					from UserList import UserList
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AutoFileTests(unittest.TestCase):
 | 
					class AutoFileTests(unittest.TestCase):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import os, filecmp, shutil, tempfile, shutil
 | 
					import os, filecmp, shutil, tempfile
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,8 +10,7 @@
 | 
				
			||||||
from weakref import proxy
 | 
					from weakref import proxy
 | 
				
			||||||
from functools import wraps
 | 
					from functools import wraps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test.test_support import (TESTFN, findfile, check_warnings, run_unittest,
 | 
					from test.test_support import TESTFN, check_warnings, run_unittest, make_bad_fd
 | 
				
			||||||
                               make_bad_fd)
 | 
					 | 
				
			||||||
from test.test_support import py3k_bytes as bytes
 | 
					from test.test_support import py3k_bytes as bytes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from _io import FileIO as _FileIO
 | 
					from _io import FileIO as _FileIO
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -523,7 +523,6 @@ def test_float_specials_do_unpack(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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():
 | 
				
			||||||
| 
						 | 
					@ -537,7 +536,6 @@ def neg_neg():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if float.__getformat__("double").startswith("IEEE"):
 | 
					    if float.__getformat__("double").startswith("IEEE"):
 | 
				
			||||||
        def test_underflow_sign(self):
 | 
					        def test_underflow_sign(self):
 | 
				
			||||||
            import math
 | 
					 | 
				
			||||||
            # check that -1e-1000 gives -0.0, not 0.0
 | 
					            # check that -1e-1000 gives -0.0, not 0.0
 | 
				
			||||||
            self.assertEquals(math.atan2(-1e-1000, -1), math.atan2(-0.0, -1))
 | 
					            self.assertEquals(math.atan2(-1e-1000, -1), math.atan2(-0.0, -1))
 | 
				
			||||||
            self.assertEquals(math.atan2(float('-1e-1000'), -1),
 | 
					            self.assertEquals(math.atan2(float('-1e-1000'), -1),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
"""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 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test.test_support import captured_stdout, run_unittest
 | 
					from test.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):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# we're testing the behavior of these future builtins:
 | 
					# we're testing the behavior of these future builtins:
 | 
				
			||||||
from future_builtins import hex, oct, map, zip, filter
 | 
					from future_builtins import hex, oct, map, zip, filter
 | 
				
			||||||
from test import test_support
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BuiltinTest(unittest.TestCase):
 | 
					class BuiltinTest(unittest.TestCase):
 | 
				
			||||||
    def test_hex(self):
 | 
					    def test_hex(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
from test.test_support import (verbose, TESTFN, run_unittest, unlink,
 | 
					from test.test_support import TESTFN, run_unittest, unlink, import_module
 | 
				
			||||||
    import_module)
 | 
					 | 
				
			||||||
gdbm = import_module('gdbm')
 | 
					gdbm = import_module('gdbm')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,6 @@
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import getopt
 | 
					import getopt
 | 
				
			||||||
import os
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
sentinel = object()
 | 
					sentinel = object()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import array
 | 
					import array
 | 
				
			||||||
import hashlib
 | 
					import hashlib
 | 
				
			||||||
import StringIO
 | 
					 | 
				
			||||||
import itertools
 | 
					import itertools
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -367,8 +367,6 @@ def test_iterable_args(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_main(verbose=None):
 | 
					def test_main(verbose=None):
 | 
				
			||||||
    from types import BuiltinFunctionType
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
 | 
					    test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
 | 
				
			||||||
    test_support.run_unittest(*test_classes)
 | 
					    test_support.run_unittest(*test_classes)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,10 +7,7 @@
 | 
				
			||||||
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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
import inspect
 | 
					import inspect
 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test.test_support import TESTFN, run_unittest
 | 
					from test.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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,9 +31,8 @@
 | 
				
			||||||
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 test_support as support
 | 
					from test import test_support as support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,7 +42,6 @@
 | 
				
			||||||
     find_unused_port
 | 
					     find_unused_port
 | 
				
			||||||
import textwrap
 | 
					import textwrap
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
import time
 | 
					 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import warnings
 | 
					import warnings
 | 
				
			||||||
import weakref
 | 
					import weakref
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -583,8 +583,6 @@ def __getslice__(self, i, j):
 | 
				
			||||||
# ----------------------------------- tests of auto int->long conversion
 | 
					# ----------------------------------- tests of auto int->long conversion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_auto_overflow(self):
 | 
					    def test_auto_overflow(self):
 | 
				
			||||||
        import math, sys
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        special = [0, 1, 2, 3, sys.maxint-1, sys.maxint, sys.maxint+1]
 | 
					        special = [0, 1, 2, 3, sys.maxint-1, sys.maxint, sys.maxint+1]
 | 
				
			||||||
        sqrt = int(math.sqrt(sys.maxint))
 | 
					        sqrt = int(math.sqrt(sys.maxint))
 | 
				
			||||||
        special.extend([sqrt-1, sqrt, sqrt+1])
 | 
					        special.extend([sqrt-1, sqrt, sqrt+1])
 | 
				
			||||||
| 
						 | 
					@ -704,8 +702,6 @@ def test_float_conversion(self):
 | 
				
			||||||
            self.assertEqual(long(float(x)), y)
 | 
					            self.assertEqual(long(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(long(x)), x)
 | 
					            self.assertEqual(float(long(x)), x)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -735,8 +731,6 @@ def test_float_overflow(self):
 | 
				
			||||||
                "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 range(10) + [100, 1000, 10000]:
 | 
					        for exp in range(10) + [100, 1000, 10000]:
 | 
				
			||||||
| 
						 | 
					@ -756,7 +750,6 @@ def test_logs(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,6 @@
 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MacOS = test_support.import_module('MacOS')
 | 
					MacOS = test_support.import_module('MacOS')
 | 
				
			||||||
#The following should exist if MacOS exists.
 | 
					 | 
				
			||||||
import Carbon.File
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
TESTFN2 = test_support.TESTFN + '2'
 | 
					TESTFN2 = test_support.TESTFN + '2'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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 @@
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
from test import test_multibytecodec_support
 | 
					 | 
				
			||||||
from test.test_support import TESTFN
 | 
					from test.test_support import TESTFN
 | 
				
			||||||
import unittest, StringIO, codecs, sys, os
 | 
					import unittest, StringIO, codecs, sys, os
 | 
				
			||||||
import _multibytecodec
 | 
					import _multibytecodec
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
import ntpath
 | 
					import ntpath
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
from test.test_support import verbose, TestFailed
 | 
					from test.test_support import TestFailed
 | 
				
			||||||
import test.test_support as test_support
 | 
					import test.test_support as test_support
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,9 +19,9 @@
 | 
				
			||||||
from test import test_support
 | 
					from test import test_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
 | 
				
			||||||
| 
						 | 
					@ -1236,7 +1236,6 @@ def setUp(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -134,7 +134,6 @@ def test_tmpfile(self):
 | 
				
			||||||
        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,
 | 
				
			||||||
| 
						 | 
					@ -185,8 +184,6 @@ def test_stat_attributes(self):
 | 
				
			||||||
        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):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
import parser
 | 
					import parser
 | 
				
			||||||
import os
 | 
					 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 test_support
 | 
					from test import test_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 @@
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
from StringIO import StringIO
 | 
					from StringIO import StringIO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NotDefined = object()
 | 
					NotDefined = object()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,5 @@
 | 
				
			||||||
"""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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,6 @@
 | 
				
			||||||
import StringIO, sys
 | 
					import StringIO, sys
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import pyexpat
 | 
					 | 
				
			||||||
from xml.parsers import expat
 | 
					from xml.parsers import expat
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test.test_support import sortdict, run_unittest
 | 
					from test.test_support import sortdict, run_unittest
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
# 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 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 functools import reduce
 | 
					from functools import reduce
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
from test.test_support import verbose, run_unittest
 | 
					from test.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
 | 
				
			||||||
| 
						 | 
					@ -715,7 +715,7 @@ def test_dealloc(self):
 | 
				
			||||||
        self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
 | 
					        self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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 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 collections
 | 
					import collections
 | 
				
			||||||
| 
						 | 
					@ -1694,7 +1693,6 @@ def test_cuboctahedron(self):
 | 
				
			||||||
#==============================================================================
 | 
					#==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_main(verbose=None):
 | 
					def test_main(verbose=None):
 | 
				
			||||||
    from test import test_sets
 | 
					 | 
				
			||||||
    test_classes = (
 | 
					    test_classes = (
 | 
				
			||||||
        TestSet,
 | 
					        TestSet,
 | 
				
			||||||
        TestSetSubclass,
 | 
					        TestSetSubclass,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import contextlib
 | 
					import contextlib
 | 
				
			||||||
import errno
 | 
					 | 
				
			||||||
import imp
 | 
					import imp
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import select
 | 
					import select
 | 
				
			||||||
| 
						 | 
					@ -11,13 +10,11 @@
 | 
				
			||||||
import socket
 | 
					import socket
 | 
				
			||||||
import tempfile
 | 
					import tempfile
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
import time
 | 
					 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import SocketServer
 | 
					import SocketServer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import test.test_support
 | 
					import test.test_support
 | 
				
			||||||
from test.test_support import reap_children, reap_threads, verbose
 | 
					from test.test_support import reap_children, reap_threads, verbose
 | 
				
			||||||
from test.test_support import TESTFN as TEST_FILE
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.test_support.requires("network")
 | 
					test.test_support.requires("network")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
import unittest
 | 
					 | 
				
			||||||
from test.test_support import run_unittest, import_module
 | 
					from test.test_support import run_unittest, import_module
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Skip test if _sqlite3 module was not built.
 | 
					# Skip test if _sqlite3 module was not built.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,13 +6,10 @@
 | 
				
			||||||
import asyncore
 | 
					import asyncore
 | 
				
			||||||
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, urlparse
 | 
					import urllib, urlparse
 | 
				
			||||||
import shutil
 | 
					 | 
				
			||||||
import traceback
 | 
					import traceback
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from BaseHTTPServer import HTTPServer
 | 
					from BaseHTTPServer import HTTPServer
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import calendar
 | 
					import calendar
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import os
 | 
					 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,7 @@
 | 
				
			||||||
                        DeprecationWarning)
 | 
					                        DeprecationWarning)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from functools import wraps
 | 
					from functools import wraps
 | 
				
			||||||
from test.test_support import TestFailed, verbose, run_unittest
 | 
					from test.test_support import run_unittest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
ISBIGENDIAN = sys.byteorder == "big"
 | 
					ISBIGENDIAN = sys.byteorder == "big"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
    LONG_MAX, LONG_MIN, ULONG_MAX, \
 | 
					    LONG_MAX, LONG_MIN, ULONG_MAX, \
 | 
				
			||||||
    LLONG_MAX, LLONG_MIN, ULLONG_MAX
 | 
					    LLONG_MAX, LLONG_MIN, ULLONG_MAX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import warnings, exceptions, unittest, sys
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ts=test_structmembersType(False, 1, 2, 3, 4, 5, 6, 7, 8,
 | 
					ts=test_structmembersType(False, 1, 2, 3, 4, 5, 6, 7, 8,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
# -*- coding: iso-8859-1 -*-
 | 
					# -*- coding: iso-8859-1 -*-
 | 
				
			||||||
import unittest, test.test_support
 | 
					import unittest, test.test_support
 | 
				
			||||||
import sys, cStringIO, os
 | 
					import sys, os, cStringIO
 | 
				
			||||||
import struct
 | 
					import struct
 | 
				
			||||||
import operator
 | 
					import operator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -415,7 +415,7 @@ def test_clear_type_cache(self):
 | 
				
			||||||
        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 @@
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import test
 | 
					 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import shutil
 | 
					import shutil
 | 
				
			||||||
from copy import copy, deepcopy
 | 
					from copy import copy, deepcopy
 | 
				
			||||||
| 
						 | 
					@ -80,7 +79,7 @@ def _get_uname(self):
 | 
				
			||||||
        return self._uname
 | 
					        return self._uname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _cleanup_testfn(self):
 | 
					    def _cleanup_testfn(self):
 | 
				
			||||||
        path = test.test_support.TESTFN
 | 
					        path = TESTFN
 | 
				
			||||||
        if os.path.isfile(path):
 | 
					        if os.path.isfile(path):
 | 
				
			||||||
            os.remove(path)
 | 
					            os.remove(path)
 | 
				
			||||||
        elif os.path.isdir(path):
 | 
					        elif os.path.isdir(path):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import shutil
 | 
					import shutil
 | 
				
			||||||
import tempfile
 | 
					 | 
				
			||||||
import StringIO
 | 
					import StringIO
 | 
				
			||||||
from hashlib import md5
 | 
					from hashlib import md5
 | 
				
			||||||
import errno
 | 
					import errno
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
import errno
 | 
					 | 
				
			||||||
import warnings
 | 
					import warnings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -529,7 +529,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
from tokenize import (tokenize, untokenize, generate_tokens, NUMBER, NAME, OP,
 | 
					from tokenize import (untokenize, generate_tokens, NUMBER, NAME, OP,
 | 
				
			||||||
                     STRING, ENDMARKER, tok_name)
 | 
					                     STRING, ENDMARKER, tok_name)
 | 
				
			||||||
from StringIO import StringIO
 | 
					from StringIO import StringIO
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -67,7 +67,7 @@ def test_bad_indentation(self):
 | 
				
			||||||
        self.assertTrue(err[1].find("2") == err[2].find("^"))
 | 
					        self.assertTrue(err[1].find("2") == err[2].find("^"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_bug737473(self):
 | 
					    def test_bug737473(self):
 | 
				
			||||||
        import sys, os, tempfile, time
 | 
					        import os, tempfile, time
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        savedpath = sys.path[:]
 | 
					        savedpath = sys.path[:]
 | 
				
			||||||
        testdir = tempfile.mkdtemp()
 | 
					        testdir = tempfile.mkdtemp()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Skip this test if _tkinter does not exist.
 | 
					# Skip this test if _tkinter does not exist.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,6 @@ def test_truth_values(self):
 | 
				
			||||||
        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')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,5 @@
 | 
				
			||||||
from test.test_support import run_unittest, have_unicode
 | 
					from test.test_support import run_unittest
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestImplementationComparisons(unittest.TestCase):
 | 
					class TestImplementationComparisons(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,9 +6,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import socket
 | 
					import socket
 | 
				
			||||||
import urllib2
 | 
					import urllib2
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import mimetools
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _retry_thrice(func, exc, *args, **kwargs):
 | 
					def _retry_thrice(func, exc, *args, **kwargs):
 | 
				
			||||||
| 
						 | 
					@ -73,7 +71,7 @@ class AuthTests(unittest.TestCase):
 | 
				
			||||||
class CloseSocketTest(unittest.TestCase):
 | 
					class CloseSocketTest(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_close(self):
 | 
					    def test_close(self):
 | 
				
			||||||
        import socket, httplib, gc
 | 
					        import httplib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # calling .close() on urllib2's response objects should close the
 | 
					        # calling .close() on urllib2's response objects should close the
 | 
				
			||||||
        # underlying socket
 | 
					        # underlying socket
 | 
				
			||||||
| 
						 | 
					@ -154,7 +152,6 @@ def test_file(self):
 | 
				
			||||||
##             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 @@
 | 
				
			||||||
# all included components work as they should.  For a more extensive
 | 
					# all included components work as they should.  For a more extensive
 | 
				
			||||||
# test suite, see the selftest script in the ElementTree distribution.
 | 
					# test suite, see the selftest script in the ElementTree distribution.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import doctest
 | 
					 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,5 @@
 | 
				
			||||||
# xml.etree test for cElementTree
 | 
					# xml.etree test for cElementTree
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import doctest
 | 
					 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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.test_support
 | 
					import test.test_support
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import os.path
 | 
					import os.path
 | 
				
			||||||
| 
						 | 
					@ -15,8 +14,7 @@
 | 
				
			||||||
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.test_support.verbose
 | 
					verbose = test.test_support.verbose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue