diff --git a/Lib/ctypes/test/__main__.py b/Lib/ctypes/test/__main__.py deleted file mode 100644 index 362a9ec8cff6c0..00000000000000 --- a/Lib/ctypes/test/__main__.py +++ /dev/null @@ -1,4 +0,0 @@ -from ctypes.test import load_tests -import unittest - -unittest.main() diff --git a/Lib/ctypes/test/__init__.py b/Lib/test/ctypes_test/__init__.py similarity index 100% rename from Lib/ctypes/test/__init__.py rename to Lib/test/ctypes_test/__init__.py diff --git a/Lib/test/ctypes_test/__main__.py b/Lib/test/ctypes_test/__main__.py new file mode 100644 index 00000000000000..e5fd44c4e198b6 --- /dev/null +++ b/Lib/test/ctypes_test/__main__.py @@ -0,0 +1,4 @@ +from Lib.test.ctypes_test import load_tests +import unittest + +unittest.main() diff --git a/Lib/ctypes/test/test_anon.py b/Lib/test/ctypes_test/test_anon.py similarity index 100% rename from Lib/ctypes/test/test_anon.py rename to Lib/test/ctypes_test/test_anon.py diff --git a/Lib/ctypes/test/test_array_in_pointer.py b/Lib/test/ctypes_test/test_array_in_pointer.py similarity index 100% rename from Lib/ctypes/test/test_array_in_pointer.py rename to Lib/test/ctypes_test/test_array_in_pointer.py diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/test/ctypes_test/test_arrays.py similarity index 99% rename from Lib/ctypes/test/test_arrays.py rename to Lib/test/ctypes_test/test_arrays.py index 14603b7049c92c..c59f996100731e 100644 --- a/Lib/ctypes/test/test_arrays.py +++ b/Lib/test/ctypes_test/test_arrays.py @@ -3,7 +3,7 @@ import sys from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol formats = "bBhHiIlLqQfd" diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/test/ctypes_test/test_as_parameter.py similarity index 99% rename from Lib/ctypes/test/test_as_parameter.py rename to Lib/test/ctypes_test/test_as_parameter.py index f9d27cb89d341b..e6ab5ecf890663 100644 --- a/Lib/ctypes/test/test_as_parameter.py +++ b/Lib/test/ctypes_test/test_as_parameter.py @@ -1,6 +1,6 @@ import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import _ctypes_test dll = CDLL(_ctypes_test.__file__) diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/test/ctypes_test/test_bitfields.py similarity index 99% rename from Lib/ctypes/test/test_bitfields.py rename to Lib/test/ctypes_test/test_bitfields.py index 992b8c4da3a776..2e91e10a2978d4 100644 --- a/Lib/ctypes/test/test_bitfields.py +++ b/Lib/test/ctypes_test/test_bitfields.py @@ -1,5 +1,5 @@ from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import unittest import os diff --git a/Lib/ctypes/test/test_buffers.py b/Lib/test/ctypes_test/test_buffers.py similarity index 98% rename from Lib/ctypes/test/test_buffers.py rename to Lib/test/ctypes_test/test_buffers.py index 15782be757c853..0ac47586ab5728 100644 --- a/Lib/ctypes/test/test_buffers.py +++ b/Lib/test/ctypes_test/test_buffers.py @@ -1,5 +1,5 @@ from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import unittest class StringBufferTestCase(unittest.TestCase): diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/test/ctypes_test/test_bytes.py similarity index 100% rename from Lib/ctypes/test/test_bytes.py rename to Lib/test/ctypes_test/test_bytes.py diff --git a/Lib/ctypes/test/test_byteswap.py b/Lib/test/ctypes_test/test_byteswap.py similarity index 100% rename from Lib/ctypes/test/test_byteswap.py rename to Lib/test/ctypes_test/test_byteswap.py diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/test/ctypes_test/test_callbacks.py similarity index 99% rename from Lib/ctypes/test/test_callbacks.py rename to Lib/test/ctypes_test/test_callbacks.py index f622093df61da5..a639a8a83b3bc4 100644 --- a/Lib/ctypes/test/test_callbacks.py +++ b/Lib/test/ctypes_test/test_callbacks.py @@ -1,7 +1,7 @@ import functools import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import _ctypes_test class Callbacks(unittest.TestCase): diff --git a/Lib/ctypes/test/test_cast.py b/Lib/test/ctypes_test/test_cast.py similarity index 98% rename from Lib/ctypes/test/test_cast.py rename to Lib/test/ctypes_test/test_cast.py index 6878f9732826f1..b06eee5ba708b5 100644 --- a/Lib/ctypes/test/test_cast.py +++ b/Lib/test/ctypes_test/test_cast.py @@ -1,5 +1,5 @@ from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import unittest import sys diff --git a/Lib/ctypes/test/test_cfuncs.py b/Lib/test/ctypes_test/test_cfuncs.py similarity index 99% rename from Lib/ctypes/test/test_cfuncs.py rename to Lib/test/ctypes_test/test_cfuncs.py index ac2240fa197d3f..3a99f535eea150 100644 --- a/Lib/ctypes/test/test_cfuncs.py +++ b/Lib/test/ctypes_test/test_cfuncs.py @@ -3,7 +3,7 @@ import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import _ctypes_test diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/test/ctypes_test/test_checkretval.py similarity index 95% rename from Lib/ctypes/test/test_checkretval.py rename to Lib/test/ctypes_test/test_checkretval.py index e9567dc3912585..ff7f1717133732 100644 --- a/Lib/ctypes/test/test_checkretval.py +++ b/Lib/test/ctypes_test/test_checkretval.py @@ -1,7 +1,7 @@ import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol class CHECKED(c_int): def _check_retval_(value): diff --git a/Lib/ctypes/test/test_delattr.py b/Lib/test/ctypes_test/test_delattr.py similarity index 100% rename from Lib/ctypes/test/test_delattr.py rename to Lib/test/ctypes_test/test_delattr.py diff --git a/Lib/ctypes/test/test_errno.py b/Lib/test/ctypes_test/test_errno.py similarity index 100% rename from Lib/ctypes/test/test_errno.py rename to Lib/test/ctypes_test/test_errno.py diff --git a/Lib/ctypes/test/test_find.py b/Lib/test/ctypes_test/test_find.py similarity index 100% rename from Lib/ctypes/test/test_find.py rename to Lib/test/ctypes_test/test_find.py diff --git a/Lib/ctypes/test/test_frombuffer.py b/Lib/test/ctypes_test/test_frombuffer.py similarity index 100% rename from Lib/ctypes/test/test_frombuffer.py rename to Lib/test/ctypes_test/test_frombuffer.py diff --git a/Lib/ctypes/test/test_funcptr.py b/Lib/test/ctypes_test/test_funcptr.py similarity index 100% rename from Lib/ctypes/test/test_funcptr.py rename to Lib/test/ctypes_test/test_funcptr.py diff --git a/Lib/ctypes/test/test_functions.py b/Lib/test/ctypes_test/test_functions.py similarity index 99% rename from Lib/ctypes/test/test_functions.py rename to Lib/test/ctypes_test/test_functions.py index 75628924206bce..6a2b3419a79b57 100644 --- a/Lib/ctypes/test/test_functions.py +++ b/Lib/test/ctypes_test/test_functions.py @@ -6,7 +6,7 @@ """ from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import sys, unittest try: diff --git a/Lib/ctypes/test/test_incomplete.py b/Lib/test/ctypes_test/test_incomplete.py similarity index 100% rename from Lib/ctypes/test/test_incomplete.py rename to Lib/test/ctypes_test/test_incomplete.py diff --git a/Lib/ctypes/test/test_init.py b/Lib/test/ctypes_test/test_init.py similarity index 100% rename from Lib/ctypes/test/test_init.py rename to Lib/test/ctypes_test/test_init.py diff --git a/Lib/ctypes/test/test_internals.py b/Lib/test/ctypes_test/test_internals.py similarity index 100% rename from Lib/ctypes/test/test_internals.py rename to Lib/test/ctypes_test/test_internals.py diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/test/ctypes_test/test_keeprefs.py similarity index 100% rename from Lib/ctypes/test/test_keeprefs.py rename to Lib/test/ctypes_test/test_keeprefs.py diff --git a/Lib/ctypes/test/test_libc.py b/Lib/test/ctypes_test/test_libc.py similarity index 100% rename from Lib/ctypes/test/test_libc.py rename to Lib/test/ctypes_test/test_libc.py diff --git a/Lib/ctypes/test/test_loading.py b/Lib/test/ctypes_test/test_loading.py similarity index 100% rename from Lib/ctypes/test/test_loading.py rename to Lib/test/ctypes_test/test_loading.py diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/test/ctypes_test/test_macholib.py similarity index 100% rename from Lib/ctypes/test/test_macholib.py rename to Lib/test/ctypes_test/test_macholib.py diff --git a/Lib/ctypes/test/test_memfunctions.py b/Lib/test/ctypes_test/test_memfunctions.py similarity index 98% rename from Lib/ctypes/test/test_memfunctions.py rename to Lib/test/ctypes_test/test_memfunctions.py index e784b9a7068422..f67101fc00e491 100644 --- a/Lib/ctypes/test/test_memfunctions.py +++ b/Lib/test/ctypes_test/test_memfunctions.py @@ -2,7 +2,7 @@ from test import support import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol class MemFunctionsTest(unittest.TestCase): @unittest.skip('test disabled') diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/test/ctypes_test/test_numbers.py similarity index 100% rename from Lib/ctypes/test/test_numbers.py rename to Lib/test/ctypes_test/test_numbers.py diff --git a/Lib/ctypes/test/test_objects.py b/Lib/test/ctypes_test/test_objects.py similarity index 88% rename from Lib/ctypes/test/test_objects.py rename to Lib/test/ctypes_test/test_objects.py index 19e3dc1f2d7621..33bbbc787822aa 100644 --- a/Lib/ctypes/test/test_objects.py +++ b/Lib/test/ctypes_test/test_objects.py @@ -42,7 +42,7 @@ of 'x' ('_b_base_' is either None, or the root object owning the memory block): >>> print(x.array._b_base_) # doctest: +ELLIPSIS - + >>> >>> x.array[0] = b'spam spam spam' @@ -55,13 +55,12 @@ ''' import unittest, doctest - -import ctypes.test.test_objects +import Lib.test.ctypes_test.test_objects as test_objects class TestCase(unittest.TestCase): def test(self): - failures, tests = doctest.testmod(ctypes.test.test_objects) + failures, tests = doctest.testmod(test_objects) self.assertFalse(failures, 'doctests failed, see output above') if __name__ == '__main__': - doctest.testmod(ctypes.test.test_objects) + doctest.testmod(test_objects) diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/test/ctypes_test/test_parameters.py similarity index 99% rename from Lib/ctypes/test/test_parameters.py rename to Lib/test/ctypes_test/test_parameters.py index e4c25fd880cefb..380bf025b3aea8 100644 --- a/Lib/ctypes/test/test_parameters.py +++ b/Lib/test/ctypes_test/test_parameters.py @@ -1,5 +1,5 @@ import unittest -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import test.support class SimpleTypesTestCase(unittest.TestCase): diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/test/ctypes_test/test_pep3118.py similarity index 100% rename from Lib/ctypes/test/test_pep3118.py rename to Lib/test/ctypes_test/test_pep3118.py diff --git a/Lib/ctypes/test/test_pickling.py b/Lib/test/ctypes_test/test_pickling.py similarity index 100% rename from Lib/ctypes/test/test_pickling.py rename to Lib/test/ctypes_test/test_pickling.py diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/test/ctypes_test/test_pointers.py similarity index 100% rename from Lib/ctypes/test/test_pointers.py rename to Lib/test/ctypes_test/test_pointers.py diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/test/ctypes_test/test_prototypes.py similarity index 99% rename from Lib/ctypes/test/test_prototypes.py rename to Lib/test/ctypes_test/test_prototypes.py index cd0c649de3e31b..a405bc4fde7e5f 100644 --- a/Lib/ctypes/test/test_prototypes.py +++ b/Lib/test/ctypes_test/test_prototypes.py @@ -1,5 +1,5 @@ from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import unittest # IMPORTANT INFO: diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/test/ctypes_test/test_python_api.py similarity index 100% rename from Lib/ctypes/test/test_python_api.py rename to Lib/test/ctypes_test/test_python_api.py diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/test/ctypes_test/test_random_things.py similarity index 100% rename from Lib/ctypes/test/test_random_things.py rename to Lib/test/ctypes_test/test_random_things.py diff --git a/Lib/ctypes/test/test_refcounts.py b/Lib/test/ctypes_test/test_refcounts.py similarity index 100% rename from Lib/ctypes/test/test_refcounts.py rename to Lib/test/ctypes_test/test_refcounts.py diff --git a/Lib/ctypes/test/test_repr.py b/Lib/test/ctypes_test/test_repr.py similarity index 100% rename from Lib/ctypes/test/test_repr.py rename to Lib/test/ctypes_test/test_repr.py diff --git a/Lib/ctypes/test/test_returnfuncptrs.py b/Lib/test/ctypes_test/test_returnfuncptrs.py similarity index 100% rename from Lib/ctypes/test/test_returnfuncptrs.py rename to Lib/test/ctypes_test/test_returnfuncptrs.py diff --git a/Lib/ctypes/test/test_simplesubclasses.py b/Lib/test/ctypes_test/test_simplesubclasses.py similarity index 100% rename from Lib/ctypes/test/test_simplesubclasses.py rename to Lib/test/ctypes_test/test_simplesubclasses.py diff --git a/Lib/ctypes/test/test_sizes.py b/Lib/test/ctypes_test/test_sizes.py similarity index 100% rename from Lib/ctypes/test/test_sizes.py rename to Lib/test/ctypes_test/test_sizes.py diff --git a/Lib/ctypes/test/test_slicing.py b/Lib/test/ctypes_test/test_slicing.py similarity index 99% rename from Lib/ctypes/test/test_slicing.py rename to Lib/test/ctypes_test/test_slicing.py index a3932f176728af..faf0deca798819 100644 --- a/Lib/ctypes/test/test_slicing.py +++ b/Lib/test/ctypes_test/test_slicing.py @@ -1,6 +1,6 @@ import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import _ctypes_test diff --git a/Lib/ctypes/test/test_stringptr.py b/Lib/test/ctypes_test/test_stringptr.py similarity index 100% rename from Lib/ctypes/test/test_stringptr.py rename to Lib/test/ctypes_test/test_stringptr.py diff --git a/Lib/ctypes/test/test_strings.py b/Lib/test/ctypes_test/test_strings.py similarity index 99% rename from Lib/ctypes/test/test_strings.py rename to Lib/test/ctypes_test/test_strings.py index 5434efda10c057..3edff2d5785ae7 100644 --- a/Lib/ctypes/test/test_strings.py +++ b/Lib/test/ctypes_test/test_strings.py @@ -1,6 +1,6 @@ import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol class StringArrayTestCase(unittest.TestCase): def test(self): diff --git a/Lib/ctypes/test/test_struct_fields.py b/Lib/test/ctypes_test/test_struct_fields.py similarity index 100% rename from Lib/ctypes/test/test_struct_fields.py rename to Lib/test/ctypes_test/test_struct_fields.py diff --git a/Lib/ctypes/test/test_structures.py b/Lib/test/ctypes_test/test_structures.py similarity index 99% rename from Lib/ctypes/test/test_structures.py rename to Lib/test/ctypes_test/test_structures.py index 245cd94c5cdd9e..e189f7e5cfc5af 100644 --- a/Lib/ctypes/test/test_structures.py +++ b/Lib/test/ctypes_test/test_structures.py @@ -2,7 +2,7 @@ import sys import unittest from ctypes import * -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol from struct import calcsize import _ctypes_test from test import support diff --git a/Lib/ctypes/test/test_unaligned_structures.py b/Lib/test/ctypes_test/test_unaligned_structures.py similarity index 100% rename from Lib/ctypes/test/test_unaligned_structures.py rename to Lib/test/ctypes_test/test_unaligned_structures.py diff --git a/Lib/ctypes/test/test_unicode.py b/Lib/test/ctypes_test/test_unicode.py similarity index 97% rename from Lib/ctypes/test/test_unicode.py rename to Lib/test/ctypes_test/test_unicode.py index c200af7b650661..4879f493240737 100644 --- a/Lib/ctypes/test/test_unicode.py +++ b/Lib/test/ctypes_test/test_unicode.py @@ -1,6 +1,6 @@ import unittest import ctypes -from ctypes.test import need_symbol +from Lib.test.ctypes_test import need_symbol import _ctypes_test diff --git a/Lib/ctypes/test/test_values.py b/Lib/test/ctypes_test/test_values.py similarity index 100% rename from Lib/ctypes/test/test_values.py rename to Lib/test/ctypes_test/test_values.py diff --git a/Lib/ctypes/test/test_varsize_struct.py b/Lib/test/ctypes_test/test_varsize_struct.py similarity index 100% rename from Lib/ctypes/test/test_varsize_struct.py rename to Lib/test/ctypes_test/test_varsize_struct.py diff --git a/Lib/ctypes/test/test_win32.py b/Lib/test/ctypes_test/test_win32.py similarity index 100% rename from Lib/ctypes/test/test_win32.py rename to Lib/test/ctypes_test/test_win32.py diff --git a/Lib/ctypes/test/test_wintypes.py b/Lib/test/ctypes_test/test_wintypes.py similarity index 100% rename from Lib/ctypes/test/test_wintypes.py rename to Lib/test/ctypes_test/test_wintypes.py diff --git a/Lib/distutils/tests/Setup.sample b/Lib/test/distutils_tests/Setup.sample similarity index 100% rename from Lib/distutils/tests/Setup.sample rename to Lib/test/distutils_tests/Setup.sample diff --git a/Lib/distutils/tests/__init__.py b/Lib/test/distutils_tests/__init__.py similarity index 80% rename from Lib/distutils/tests/__init__.py rename to Lib/test/distutils_tests/__init__.py index 1b939cbd5db2bf..ba484805fc6885 100644 --- a/Lib/distutils/tests/__init__.py +++ b/Lib/test/distutils_tests/__init__.py @@ -1,12 +1,12 @@ """Test suite for distutils. This test suite consists of a collection of test modules in the -distutils.tests package. Each test module has a name starting with +Lib.test.distutils_tests package. Each test module has a name starting with 'test' and contains a function test_suite(). The function is expected to return an initialized unittest.TestSuite instance. Tests for the command classes in the distutils.command package are -included in distutils.tests as well, instead of using a separate +included in Lib.test.distutils_tests as well, instead of using a separate distutils.command.tests package, since command identification is done by import rather than matching pre-defined names. @@ -25,7 +25,7 @@ def test_suite(): suite = unittest.TestSuite() for fn in os.listdir(here): if fn.startswith("test") and fn.endswith(".py"): - modname = "distutils.tests." + fn[:-3] + modname = "Lib.test.distutils_tests." + fn[:-3] __import__(modname) module = sys.modules[modname] suite.addTest(module.test_suite()) diff --git a/Lib/distutils/tests/includetest.rst b/Lib/test/distutils_tests/includetest.rst similarity index 100% rename from Lib/distutils/tests/includetest.rst rename to Lib/test/distutils_tests/includetest.rst diff --git a/Lib/distutils/tests/support.py b/Lib/test/distutils_tests/support.py similarity index 100% rename from Lib/distutils/tests/support.py rename to Lib/test/distutils_tests/support.py diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/test/distutils_tests/test_archive_util.py similarity index 99% rename from Lib/distutils/tests/test_archive_util.py rename to Lib/test/distutils_tests/test_archive_util.py index e9aad0e40fd14c..11412fa95f14f3 100644 --- a/Lib/distutils/tests/test_archive_util.py +++ b/Lib/test/distutils_tests/test_archive_util.py @@ -12,7 +12,7 @@ make_zipfile, make_archive, ARCHIVE_FORMATS) from distutils.spawn import find_executable, spawn -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import check_warnings, run_unittest, patch, change_cwd try: diff --git a/Lib/distutils/tests/test_bdist.py b/Lib/test/distutils_tests/test_bdist.py similarity index 97% rename from Lib/distutils/tests/test_bdist.py rename to Lib/test/distutils_tests/test_bdist.py index 130d8bf155a45c..50397bfdd3751a 100644 --- a/Lib/distutils/tests/test_bdist.py +++ b/Lib/test/distutils_tests/test_bdist.py @@ -5,7 +5,7 @@ import warnings from distutils.command.bdist import bdist -from distutils.tests import support +from Lib.test.distutils_tests import support class BuildTestCase(support.TempdirManager, diff --git a/Lib/distutils/tests/test_bdist_dumb.py b/Lib/test/distutils_tests/test_bdist_dumb.py similarity index 98% rename from Lib/distutils/tests/test_bdist_dumb.py rename to Lib/test/distutils_tests/test_bdist_dumb.py index 01a233bce37ff9..76c01929f66ab6 100644 --- a/Lib/distutils/tests/test_bdist_dumb.py +++ b/Lib/test/distutils_tests/test_bdist_dumb.py @@ -8,7 +8,7 @@ from distutils.core import Distribution from distutils.command.bdist_dumb import bdist_dumb -from distutils.tests import support +from Lib.test.distutils_tests import support SETUP_PY = """\ from distutils.core import setup diff --git a/Lib/distutils/tests/test_bdist_msi.py b/Lib/test/distutils_tests/test_bdist_msi.py similarity index 94% rename from Lib/distutils/tests/test_bdist_msi.py rename to Lib/test/distutils_tests/test_bdist_msi.py index 418e60ec729779..dcd042aaf680e8 100644 --- a/Lib/distutils/tests/test_bdist_msi.py +++ b/Lib/test/distutils_tests/test_bdist_msi.py @@ -2,7 +2,7 @@ import sys import unittest from test.support import run_unittest, check_warnings -from distutils.tests import support +from Lib.test.distutils_tests import support @unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows') diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/test/distutils_tests/test_bdist_rpm.py similarity index 99% rename from Lib/distutils/tests/test_bdist_rpm.py rename to Lib/test/distutils_tests/test_bdist_rpm.py index 6453a02b88f600..7b521fea6d8a38 100644 --- a/Lib/distutils/tests/test_bdist_rpm.py +++ b/Lib/test/distutils_tests/test_bdist_rpm.py @@ -7,7 +7,7 @@ from distutils.core import Distribution from distutils.command.bdist_rpm import bdist_rpm -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils.spawn import find_executable SETUP_PY = """\ diff --git a/Lib/distutils/tests/test_bdist_wininst.py b/Lib/test/distutils_tests/test_bdist_wininst.py similarity index 96% rename from Lib/distutils/tests/test_bdist_wininst.py rename to Lib/test/distutils_tests/test_bdist_wininst.py index 5c3d025d3321d2..e222a0d5215dcb 100644 --- a/Lib/distutils/tests/test_bdist_wininst.py +++ b/Lib/test/distutils_tests/test_bdist_wininst.py @@ -5,7 +5,7 @@ from test.support import run_unittest, check_warnings from distutils.command.bdist_wininst import bdist_wininst -from distutils.tests import support +from Lib.test.distutils_tests import support @unittest.skipIf(sys.platform == 'win32' and platform.machine() == 'ARM64', 'bdist_wininst is not supported in this install') diff --git a/Lib/distutils/tests/test_build.py b/Lib/test/distutils_tests/test_build.py similarity index 97% rename from Lib/distutils/tests/test_build.py rename to Lib/test/distutils_tests/test_build.py index b020a5ba3569d7..50cd9bb68471f5 100644 --- a/Lib/distutils/tests/test_build.py +++ b/Lib/test/distutils_tests/test_build.py @@ -5,7 +5,7 @@ from test.support import run_unittest from distutils.command.build import build -from distutils.tests import support +from Lib.test.distutils_tests import support from sysconfig import get_platform class BuildTestCase(support.TempdirManager, diff --git a/Lib/distutils/tests/test_build_clib.py b/Lib/test/distutils_tests/test_build_clib.py similarity index 99% rename from Lib/distutils/tests/test_build_clib.py rename to Lib/test/distutils_tests/test_build_clib.py index 85d09906f228d4..f8290ccedcbb60 100644 --- a/Lib/distutils/tests/test_build_clib.py +++ b/Lib/test/distutils_tests/test_build_clib.py @@ -7,7 +7,7 @@ from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils.spawn import find_executable class BuildCLibTestCase(support.TempdirManager, diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/test/distutils_tests/test_build_ext.py similarity index 99% rename from Lib/distutils/tests/test_build_ext.py rename to Lib/test/distutils_tests/test_build_ext.py index 5e47e0773a9649..8203f0985036c9 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/test/distutils_tests/test_build_ext.py @@ -6,7 +6,7 @@ from distutils.core import Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig -from distutils.tests.support import (TempdirManager, LoggingSilencer, +from Lib.test.distutils_tests.support import (TempdirManager, LoggingSilencer, copy_xxmodule_c, fixup_build_ext) from distutils.extension import Extension from distutils.errors import ( diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/test/distutils_tests/test_build_py.py similarity index 99% rename from Lib/distutils/tests/test_build_py.py rename to Lib/test/distutils_tests/test_build_py.py index 0712e92c6aba4c..f3ef8bc86bd9b9 100644 --- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/test/distutils_tests/test_build_py.py @@ -8,7 +8,7 @@ from distutils.core import Distribution from distutils.errors import DistutilsFileError -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest diff --git a/Lib/distutils/tests/test_build_scripts.py b/Lib/test/distutils_tests/test_build_scripts.py similarity index 98% rename from Lib/distutils/tests/test_build_scripts.py rename to Lib/test/distutils_tests/test_build_scripts.py index 954fc763987c2a..f322825bbee2a6 100644 --- a/Lib/distutils/tests/test_build_scripts.py +++ b/Lib/test/distutils_tests/test_build_scripts.py @@ -7,7 +7,7 @@ from distutils.core import Distribution from distutils import sysconfig -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest diff --git a/Lib/distutils/tests/test_check.py b/Lib/test/distutils_tests/test_check.py similarity index 99% rename from Lib/distutils/tests/test_check.py rename to Lib/test/distutils_tests/test_check.py index e534aca1d47637..d54743e7636793 100644 --- a/Lib/distutils/tests/test_check.py +++ b/Lib/test/distutils_tests/test_check.py @@ -5,7 +5,7 @@ from test.support import run_unittest from distutils.command.check import check, HAS_DOCUTILS -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils.errors import DistutilsSetupError try: diff --git a/Lib/distutils/tests/test_clean.py b/Lib/test/distutils_tests/test_clean.py similarity index 96% rename from Lib/distutils/tests/test_clean.py rename to Lib/test/distutils_tests/test_clean.py index c605afd86012b6..71cef889a90cd3 100644 --- a/Lib/distutils/tests/test_clean.py +++ b/Lib/test/distutils_tests/test_clean.py @@ -3,7 +3,7 @@ import unittest from distutils.command.clean import clean -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest class cleanTestCase(support.TempdirManager, diff --git a/Lib/distutils/tests/test_cmd.py b/Lib/test/distutils_tests/test_cmd.py similarity index 100% rename from Lib/distutils/tests/test_cmd.py rename to Lib/test/distutils_tests/test_cmd.py diff --git a/Lib/distutils/tests/test_config.py b/Lib/test/distutils_tests/test_config.py similarity index 98% rename from Lib/distutils/tests/test_config.py rename to Lib/test/distutils_tests/test_config.py index 344084afb77912..71c283d27d8c1c 100644 --- a/Lib/distutils/tests/test_config.py +++ b/Lib/test/distutils_tests/test_config.py @@ -7,7 +7,7 @@ from distutils.log import set_threshold from distutils.log import WARN -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest PYPIRC = """\ diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/test/distutils_tests/test_config_cmd.py similarity index 98% rename from Lib/distutils/tests/test_config_cmd.py rename to Lib/test/distutils_tests/test_config_cmd.py index b735fd334d8780..b8f8c77bc68d89 100644 --- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/test/distutils_tests/test_config_cmd.py @@ -5,7 +5,7 @@ from test.support import run_unittest, missing_compiler_executable from distutils.command.config import dump_file, config -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils import log class ConfigTestCase(support.LoggingSilencer, diff --git a/Lib/distutils/tests/test_core.py b/Lib/test/distutils_tests/test_core.py similarity index 98% rename from Lib/distutils/tests/test_core.py rename to Lib/test/distutils_tests/test_core.py index 27ce7324afcfb6..5bcdeab9dce83b 100644 --- a/Lib/distutils/tests/test_core.py +++ b/Lib/test/distutils_tests/test_core.py @@ -8,7 +8,7 @@ import test.support from test.support import captured_stdout, run_unittest import unittest -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils import log # setup script that uses __file__ diff --git a/Lib/distutils/tests/test_cygwinccompiler.py b/Lib/test/distutils_tests/test_cygwinccompiler.py similarity index 99% rename from Lib/distutils/tests/test_cygwinccompiler.py rename to Lib/test/distutils_tests/test_cygwinccompiler.py index 9dc869de4c8ef0..ed89c2f522ebe4 100644 --- a/Lib/distutils/tests/test_cygwinccompiler.py +++ b/Lib/test/distutils_tests/test_cygwinccompiler.py @@ -10,7 +10,7 @@ CONFIG_H_OK, CONFIG_H_NOTOK, CONFIG_H_UNCERTAIN, get_versions, get_msvcr) -from distutils.tests import support +from Lib.test.distutils_tests import support class FakePopen(object): test_class = None diff --git a/Lib/distutils/tests/test_dep_util.py b/Lib/test/distutils_tests/test_dep_util.py similarity index 98% rename from Lib/distutils/tests/test_dep_util.py rename to Lib/test/distutils_tests/test_dep_util.py index c6fae39cfb1e07..eff2e6c0ba67bf 100644 --- a/Lib/distutils/tests/test_dep_util.py +++ b/Lib/test/distutils_tests/test_dep_util.py @@ -4,7 +4,7 @@ from distutils.dep_util import newer, newer_pairwise, newer_group from distutils.errors import DistutilsFileError -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest class DepUtilTestCase(support.TempdirManager, unittest.TestCase): diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/test/distutils_tests/test_dir_util.py similarity index 99% rename from Lib/distutils/tests/test_dir_util.py rename to Lib/test/distutils_tests/test_dir_util.py index d436cf83191715..c8662af2e39cd7 100644 --- a/Lib/distutils/tests/test_dir_util.py +++ b/Lib/test/distutils_tests/test_dir_util.py @@ -10,7 +10,7 @@ ensure_relative) from distutils import log -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest diff --git a/Lib/distutils/tests/test_dist.py b/Lib/test/distutils_tests/test_dist.py similarity index 98% rename from Lib/distutils/tests/test_dist.py rename to Lib/test/distutils_tests/test_dist.py index cc34725a99efa4..08c659023799af 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/test/distutils_tests/test_dist.py @@ -14,7 +14,7 @@ from test.support import ( TESTFN, captured_stdout, captured_stderr, run_unittest ) -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils import log @@ -69,16 +69,16 @@ def test_command_packages_unspecified(self): self.assertEqual(d.get_command_packages(), ["distutils.command"]) def test_command_packages_cmdline(self): - from distutils.tests.test_dist import test_dist + from Lib.test.distutils_tests.test_dist import test_dist sys.argv.extend(["--command-packages", - "foo.bar,distutils.tests", + "foo.bar,Lib.test.distutils_tests", "test_dist", "-Ssometext", ]) d = self.create_distribution() # let's actually try to load our test command: self.assertEqual(d.get_command_packages(), - ["distutils.command", "foo.bar", "distutils.tests"]) + ["distutils.command", "foo.bar", "Lib.test.distutils_tests"]) cmd = d.get_command_obj("test_dist") self.assertIsInstance(cmd, test_dist) self.assertEqual(cmd.sample_option, "sometext") diff --git a/Lib/distutils/tests/test_extension.py b/Lib/test/distutils_tests/test_extension.py similarity index 100% rename from Lib/distutils/tests/test_extension.py rename to Lib/test/distutils_tests/test_extension.py diff --git a/Lib/distutils/tests/test_file_util.py b/Lib/test/distutils_tests/test_file_util.py similarity index 98% rename from Lib/distutils/tests/test_file_util.py rename to Lib/test/distutils_tests/test_file_util.py index a4e2d025f96615..faea04b0d3114c 100644 --- a/Lib/distutils/tests/test_file_util.py +++ b/Lib/test/distutils_tests/test_file_util.py @@ -6,7 +6,7 @@ from distutils.file_util import move_file, copy_file from distutils import log -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils.errors import DistutilsFileError from test.support import run_unittest, unlink diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/test/distutils_tests/test_filelist.py similarity index 99% rename from Lib/distutils/tests/test_filelist.py rename to Lib/test/distutils_tests/test_filelist.py index c71342d0dc4e7b..67daec31448b57 100644 --- a/Lib/distutils/tests/test_filelist.py +++ b/Lib/test/distutils_tests/test_filelist.py @@ -10,7 +10,7 @@ import test.support from test.support import captured_stdout, run_unittest -from distutils.tests import support +from Lib.test.distutils_tests import support MANIFEST_IN = """\ include ok diff --git a/Lib/distutils/tests/test_install.py b/Lib/test/distutils_tests/test_install.py similarity index 99% rename from Lib/distutils/tests/test_install.py rename to Lib/test/distutils_tests/test_install.py index 287ab1989e4083..e9bcc718a653cd 100644 --- a/Lib/distutils/tests/test_install.py +++ b/Lib/test/distutils_tests/test_install.py @@ -16,7 +16,7 @@ from distutils.errors import DistutilsOptionError from distutils.extension import Extension -from distutils.tests import support +from Lib.test.distutils_tests import support from test import support as test_support diff --git a/Lib/distutils/tests/test_install_data.py b/Lib/test/distutils_tests/test_install_data.py similarity index 98% rename from Lib/distutils/tests/test_install_data.py rename to Lib/test/distutils_tests/test_install_data.py index 32ab296a320e00..a97c7cf6f6007f 100644 --- a/Lib/distutils/tests/test_install_data.py +++ b/Lib/test/distutils_tests/test_install_data.py @@ -3,7 +3,7 @@ import unittest from distutils.command.install_data import install_data -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest class InstallDataTestCase(support.TempdirManager, diff --git a/Lib/distutils/tests/test_install_headers.py b/Lib/test/distutils_tests/test_install_headers.py similarity index 96% rename from Lib/distutils/tests/test_install_headers.py rename to Lib/test/distutils_tests/test_install_headers.py index 2217b321e6e054..31d1a26b962d7c 100644 --- a/Lib/distutils/tests/test_install_headers.py +++ b/Lib/test/distutils_tests/test_install_headers.py @@ -3,7 +3,7 @@ import unittest from distutils.command.install_headers import install_headers -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest class InstallHeadersTestCase(support.TempdirManager, diff --git a/Lib/distutils/tests/test_install_lib.py b/Lib/test/distutils_tests/test_install_lib.py similarity index 98% rename from Lib/distutils/tests/test_install_lib.py rename to Lib/test/distutils_tests/test_install_lib.py index fda6315bbc7b59..c6701a84ef1e2c 100644 --- a/Lib/distutils/tests/test_install_lib.py +++ b/Lib/test/distutils_tests/test_install_lib.py @@ -6,7 +6,7 @@ from distutils.command.install_lib import install_lib from distutils.extension import Extension -from distutils.tests import support +from Lib.test.distutils_tests import support from distutils.errors import DistutilsOptionError from test.support import run_unittest diff --git a/Lib/distutils/tests/test_install_scripts.py b/Lib/test/distutils_tests/test_install_scripts.py similarity index 98% rename from Lib/distutils/tests/test_install_scripts.py rename to Lib/test/distutils_tests/test_install_scripts.py index 1f7b1038cb2719..c58201f4e43829 100644 --- a/Lib/distutils/tests/test_install_scripts.py +++ b/Lib/test/distutils_tests/test_install_scripts.py @@ -6,7 +6,7 @@ from distutils.command.install_scripts import install_scripts from distutils.core import Distribution -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest diff --git a/Lib/distutils/tests/test_log.py b/Lib/test/distutils_tests/test_log.py similarity index 100% rename from Lib/distutils/tests/test_log.py rename to Lib/test/distutils_tests/test_log.py diff --git a/Lib/distutils/tests/test_msvc9compiler.py b/Lib/test/distutils_tests/test_msvc9compiler.py similarity index 99% rename from Lib/distutils/tests/test_msvc9compiler.py rename to Lib/test/distutils_tests/test_msvc9compiler.py index 77a07ef39dd1a6..905fa5d37f39ea 100644 --- a/Lib/distutils/tests/test_msvc9compiler.py +++ b/Lib/test/distutils_tests/test_msvc9compiler.py @@ -4,7 +4,7 @@ import os from distutils.errors import DistutilsPlatformError -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest # A manifest with the only assembly reference being the msvcrt assembly, so diff --git a/Lib/distutils/tests/test_msvccompiler.py b/Lib/test/distutils_tests/test_msvccompiler.py similarity index 99% rename from Lib/distutils/tests/test_msvccompiler.py rename to Lib/test/distutils_tests/test_msvccompiler.py index 70a9c93a4e8805..1992365537cb15 100644 --- a/Lib/distutils/tests/test_msvccompiler.py +++ b/Lib/test/distutils_tests/test_msvccompiler.py @@ -4,7 +4,7 @@ import os from distutils.errors import DistutilsPlatformError -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest diff --git a/Lib/distutils/tests/test_register.py b/Lib/test/distutils_tests/test_register.py similarity index 99% rename from Lib/distutils/tests/test_register.py rename to Lib/test/distutils_tests/test_register.py index e68b0af3ce0c3a..6e34f32c8d70ce 100644 --- a/Lib/distutils/tests/test_register.py +++ b/Lib/test/distutils_tests/test_register.py @@ -12,7 +12,7 @@ from distutils.errors import DistutilsSetupError from distutils.log import INFO -from distutils.tests.test_config import BasePyPIRCCommandTestCase +from Lib.test.distutils_tests.test_config import BasePyPIRCCommandTestCase try: import docutils diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/test/distutils_tests/test_sdist.py similarity index 99% rename from Lib/distutils/tests/test_sdist.py rename to Lib/test/distutils_tests/test_sdist.py index 23db1269591d66..5225c583c7e9c2 100644 --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/test/distutils_tests/test_sdist.py @@ -23,7 +23,7 @@ from distutils.command.sdist import sdist, show_formats from distutils.core import Distribution -from distutils.tests.test_config import BasePyPIRCCommandTestCase +from Lib.test.distutils_tests.test_config import BasePyPIRCCommandTestCase from distutils.errors import DistutilsOptionError from distutils.spawn import find_executable from distutils.log import WARN diff --git a/Lib/distutils/tests/test_spawn.py b/Lib/test/distutils_tests/test_spawn.py similarity index 99% rename from Lib/distutils/tests/test_spawn.py rename to Lib/test/distutils_tests/test_spawn.py index f9ae69ef86b3da..2b6a689261e963 100644 --- a/Lib/distutils/tests/test_spawn.py +++ b/Lib/test/distutils_tests/test_spawn.py @@ -11,7 +11,7 @@ from distutils.spawn import _nt_quote_args from distutils.spawn import spawn from distutils.errors import DistutilsExecError -from distutils.tests import support +from Lib.test.distutils_tests import support class SpawnTestCase(support.TempdirManager, support.LoggingSilencer, diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/test/distutils_tests/test_sysconfig.py similarity index 99% rename from Lib/distutils/tests/test_sysconfig.py rename to Lib/test/distutils_tests/test_sysconfig.py index 236755d095272f..c4a9e332174e54 100644 --- a/Lib/distutils/tests/test_sysconfig.py +++ b/Lib/test/distutils_tests/test_sysconfig.py @@ -9,7 +9,7 @@ from distutils import sysconfig from distutils.ccompiler import get_default_compiler -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import TESTFN, run_unittest, check_warnings, swap_item class SysconfigTestCase(support.EnvironGuard, unittest.TestCase): diff --git a/Lib/distutils/tests/test_text_file.py b/Lib/test/distutils_tests/test_text_file.py similarity index 98% rename from Lib/distutils/tests/test_text_file.py rename to Lib/test/distutils_tests/test_text_file.py index 7e76240a9a3071..e483bfcd19b16a 100644 --- a/Lib/distutils/tests/test_text_file.py +++ b/Lib/test/distutils_tests/test_text_file.py @@ -2,7 +2,7 @@ import os import unittest from distutils.text_file import TextFile -from distutils.tests import support +from Lib.test.distutils_tests import support from test.support import run_unittest TEST_DATA = """# test file diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/test/distutils_tests/test_unixccompiler.py similarity index 100% rename from Lib/distutils/tests/test_unixccompiler.py rename to Lib/test/distutils_tests/test_unixccompiler.py diff --git a/Lib/distutils/tests/test_upload.py b/Lib/test/distutils_tests/test_upload.py similarity index 98% rename from Lib/distutils/tests/test_upload.py rename to Lib/test/distutils_tests/test_upload.py index c17d8e7d54e98c..d07feaeacaea8a 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/test/distutils_tests/test_upload.py @@ -12,7 +12,7 @@ from distutils.errors import DistutilsError from distutils.log import ERROR, INFO -from distutils.tests.test_config import PYPIRC, BasePyPIRCCommandTestCase +from Lib.test.distutils_tests.test_config import PYPIRC, BasePyPIRCCommandTestCase PYPIRC_LONG_PASSWORD = """\ [distutils] diff --git a/Lib/distutils/tests/test_util.py b/Lib/test/distutils_tests/test_util.py similarity index 99% rename from Lib/distutils/tests/test_util.py rename to Lib/test/distutils_tests/test_util.py index bf0d4333f9aeaa..1cd07984661893 100644 --- a/Lib/distutils/tests/test_util.py +++ b/Lib/test/distutils_tests/test_util.py @@ -14,7 +14,7 @@ from distutils import util # used to patch _environ_checked from distutils.sysconfig import get_config_vars from distutils import sysconfig -from distutils.tests import support +from Lib.test.distutils_tests import support import _osx_support class UtilTestCase(support.EnvironGuard, unittest.TestCase): diff --git a/Lib/distutils/tests/test_version.py b/Lib/test/distutils_tests/test_version.py similarity index 100% rename from Lib/distutils/tests/test_version.py rename to Lib/test/distutils_tests/test_version.py diff --git a/Lib/distutils/tests/test_versionpredicate.py b/Lib/test/distutils_tests/test_versionpredicate.py similarity index 100% rename from Lib/distutils/tests/test_versionpredicate.py rename to Lib/test/distutils_tests/test_versionpredicate.py diff --git a/Lib/lib2to3/tests/__init__.py b/Lib/test/lib2to3_tests/__init__.py similarity index 100% rename from Lib/lib2to3/tests/__init__.py rename to Lib/test/lib2to3_tests/__init__.py diff --git a/Lib/lib2to3/tests/__main__.py b/Lib/test/lib2to3_tests/__main__.py similarity index 100% rename from Lib/lib2to3/tests/__main__.py rename to Lib/test/lib2to3_tests/__main__.py diff --git a/Lib/lib2to3/tests/data/README b/Lib/test/lib2to3_tests/data/README similarity index 100% rename from Lib/lib2to3/tests/data/README rename to Lib/test/lib2to3_tests/data/README diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py b/Lib/test/lib2to3_tests/data/__init__.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/myfixes/__init__.py rename to Lib/test/lib2to3_tests/data/__init__.py diff --git a/Lib/lib2to3/tests/data/bom.py b/Lib/test/lib2to3_tests/data/bom.py similarity index 100% rename from Lib/lib2to3/tests/data/bom.py rename to Lib/test/lib2to3_tests/data/bom.py diff --git a/Lib/lib2to3/tests/data/crlf.py b/Lib/test/lib2to3_tests/data/crlf.py similarity index 94% rename from Lib/lib2to3/tests/data/crlf.py rename to Lib/test/lib2to3_tests/data/crlf.py index a83ca8f0a2068f..dbe2d7bb1012ba 100644 --- a/Lib/lib2to3/tests/data/crlf.py +++ b/Lib/test/lib2to3_tests/data/crlf.py @@ -1,3 +1,3 @@ -print "hi" - -print "Like bad Windows newlines?" +print "hi" + +print "Like bad Windows newlines?" diff --git a/Lib/lib2to3/tests/data/different_encoding.py b/Lib/test/lib2to3_tests/data/different_encoding.py similarity index 100% rename from Lib/lib2to3/tests/data/different_encoding.py rename to Lib/test/lib2to3_tests/data/different_encoding.py diff --git a/Lib/lib2to3/tests/data/false_encoding.py b/Lib/test/lib2to3_tests/data/false_encoding.py similarity index 100% rename from Lib/lib2to3/tests/data/false_encoding.py rename to Lib/test/lib2to3_tests/data/false_encoding.py diff --git a/Lib/sqlite3/test/__init__.py b/Lib/test/lib2to3_tests/data/fixers/__init__.py similarity index 100% rename from Lib/sqlite3/test/__init__.py rename to Lib/test/lib2to3_tests/data/fixers/__init__.py diff --git a/Lib/lib2to3/tests/data/fixers/bad_order.py b/Lib/test/lib2to3_tests/data/fixers/bad_order.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/bad_order.py rename to Lib/test/lib2to3_tests/data/fixers/bad_order.py diff --git a/Lib/tkinter/test/__init__.py b/Lib/test/lib2to3_tests/data/fixers/myfixes/__init__.py similarity index 100% rename from Lib/tkinter/test/__init__.py rename to Lib/test/lib2to3_tests/data/fixers/myfixes/__init__.py diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py b/Lib/test/lib2to3_tests/data/fixers/myfixes/fix_explicit.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py rename to Lib/test/lib2to3_tests/data/fixers/myfixes/fix_explicit.py diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py b/Lib/test/lib2to3_tests/data/fixers/myfixes/fix_first.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py rename to Lib/test/lib2to3_tests/data/fixers/myfixes/fix_first.py diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py b/Lib/test/lib2to3_tests/data/fixers/myfixes/fix_last.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py rename to Lib/test/lib2to3_tests/data/fixers/myfixes/fix_last.py diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py b/Lib/test/lib2to3_tests/data/fixers/myfixes/fix_parrot.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py rename to Lib/test/lib2to3_tests/data/fixers/myfixes/fix_parrot.py diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py b/Lib/test/lib2to3_tests/data/fixers/myfixes/fix_preorder.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py rename to Lib/test/lib2to3_tests/data/fixers/myfixes/fix_preorder.py diff --git a/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py b/Lib/test/lib2to3_tests/data/fixers/no_fixer_cls.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/no_fixer_cls.py rename to Lib/test/lib2to3_tests/data/fixers/no_fixer_cls.py diff --git a/Lib/lib2to3/tests/data/fixers/parrot_example.py b/Lib/test/lib2to3_tests/data/fixers/parrot_example.py similarity index 100% rename from Lib/lib2to3/tests/data/fixers/parrot_example.py rename to Lib/test/lib2to3_tests/data/fixers/parrot_example.py diff --git a/Lib/lib2to3/tests/data/infinite_recursion.py b/Lib/test/lib2to3_tests/data/infinite_recursion.py similarity index 100% rename from Lib/lib2to3/tests/data/infinite_recursion.py rename to Lib/test/lib2to3_tests/data/infinite_recursion.py diff --git a/Lib/lib2to3/tests/data/py2_test_grammar.py b/Lib/test/lib2to3_tests/data/py2_test_grammar.py similarity index 100% rename from Lib/lib2to3/tests/data/py2_test_grammar.py rename to Lib/test/lib2to3_tests/data/py2_test_grammar.py diff --git a/Lib/lib2to3/tests/data/py3_test_grammar.py b/Lib/test/lib2to3_tests/data/py3_test_grammar.py similarity index 100% rename from Lib/lib2to3/tests/data/py3_test_grammar.py rename to Lib/test/lib2to3_tests/data/py3_test_grammar.py diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/test/lib2to3_tests/pytree_idempotency.py similarity index 96% rename from Lib/lib2to3/tests/pytree_idempotency.py rename to Lib/test/lib2to3_tests/pytree_idempotency.py index 2e7e9781d42995..eb2e2aa02ae0ed 100755 --- a/Lib/lib2to3/tests/pytree_idempotency.py +++ b/Lib/test/lib2to3_tests/pytree_idempotency.py @@ -17,9 +17,9 @@ import logging # Local imports -from .. import pytree -from .. import pgen2 -from ..pgen2 import driver +from lib2to3 import pytree +from lib2to3 import pgen2 +from lib2to3.pgen2 import driver logging.basicConfig() diff --git a/Lib/lib2to3/tests/support.py b/Lib/test/lib2to3_tests/support.py similarity index 92% rename from Lib/lib2to3/tests/support.py rename to Lib/test/lib2to3_tests/support.py index fe084e8903fc86..a593a711257d0a 100644 --- a/Lib/lib2to3/tests/support.py +++ b/Lib/test/lib2to3_tests/support.py @@ -12,8 +12,8 @@ from lib2to3.pgen2 import driver as pgen2_driver test_dir = os.path.dirname(__file__) -proj_dir = os.path.normpath(os.path.join(test_dir, "..")) -grammar_path = os.path.join(test_dir, "..", "Grammar.txt") +proj_dir = os.path.normpath(os.path.join(test_dir, "../../lib2to3")) +grammar_path = os.path.join(test_dir, "../../lib2to3", "Grammar.txt") grammar = pgen2_driver.load_grammar(grammar_path) grammar_no_print_statement = pgen2_driver.load_grammar(grammar_path) del grammar_no_print_statement.keywords["print"] diff --git a/Lib/lib2to3/tests/test_all_fixers.py b/Lib/test/lib2to3_tests/test_all_fixers.py similarity index 100% rename from Lib/lib2to3/tests/test_all_fixers.py rename to Lib/test/lib2to3_tests/test_all_fixers.py diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/test/lib2to3_tests/test_fixers.py similarity index 99% rename from Lib/lib2to3/tests/test_fixers.py rename to Lib/test/lib2to3_tests/test_fixers.py index a2852419818133..42152d64af19ce 100644 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/test/lib2to3_tests/test_fixers.py @@ -7,7 +7,7 @@ # Local imports from lib2to3 import pygram, fixer_util -from lib2to3.tests import support +from Lib.test.lib2to3_tests import support class FixerTestCase(support.TestCase): @@ -1791,7 +1791,7 @@ def f(): class Test_imports(FixerTestCase, ImportsFixerTests): fixer = "imports" - from ..fixes.fix_imports import MAPPING as modules + from lib2to3.fixes.fix_imports import MAPPING as modules def test_multiple_imports(self): b = """import urlparse, cStringIO""" @@ -1812,16 +1812,16 @@ def test_multiple_imports_as(self): class Test_imports2(FixerTestCase, ImportsFixerTests): fixer = "imports2" - from ..fixes.fix_imports2 import MAPPING as modules + from lib2to3.fixes.fix_imports2 import MAPPING as modules class Test_imports_fixer_order(FixerTestCase, ImportsFixerTests): def setUp(self): super(Test_imports_fixer_order, self).setUp(['imports', 'imports2']) - from ..fixes.fix_imports2 import MAPPING as mapping2 + from lib2to3.fixes.fix_imports2 import MAPPING as mapping2 self.modules = mapping2.copy() - from ..fixes.fix_imports import MAPPING as mapping1 + from lib2to3.fixes.fix_imports import MAPPING as mapping1 for key in ('dbhash', 'dumbdbm', 'dbm', 'gdbm'): self.modules[key] = mapping1[key] @@ -1833,7 +1833,7 @@ def test_after_local_imports_refactoring(self): class Test_urllib(FixerTestCase): fixer = "urllib" - from ..fixes.fix_urllib import MAPPING as modules + from lib2to3.fixes.fix_urllib import MAPPING as modules def test_import_module(self): for old, changes in self.modules.items(): diff --git a/Lib/lib2to3/tests/test_main.py b/Lib/test/lib2to3_tests/test_main.py similarity index 100% rename from Lib/lib2to3/tests/test_main.py rename to Lib/test/lib2to3_tests/test_main.py diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/test/lib2to3_tests/test_parser.py similarity index 99% rename from Lib/lib2to3/tests/test_parser.py rename to Lib/test/lib2to3_tests/test_parser.py index a0c31e8f5300dd..385688e50bde4f 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/test/lib2to3_tests/test_parser.py @@ -25,7 +25,7 @@ # Local imports from lib2to3.pgen2 import driver as pgen2_driver from lib2to3.pgen2 import tokenize -from ..pgen2.parse import ParseError +from lib2to3.pgen2.parse import ParseError from lib2to3.pygram import python_symbols as syms diff --git a/Lib/lib2to3/tests/test_pytree.py b/Lib/test/lib2to3_tests/test_pytree.py similarity index 100% rename from Lib/lib2to3/tests/test_pytree.py rename to Lib/test/lib2to3_tests/test_pytree.py diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/test/lib2to3_tests/test_refactor.py similarity index 96% rename from Lib/lib2to3/tests/test_refactor.py rename to Lib/test/lib2to3_tests/test_refactor.py index be705679f06dba..b38c785244cebf 100644 --- a/Lib/lib2to3/tests/test_refactor.py +++ b/Lib/test/lib2to3_tests/test_refactor.py @@ -135,10 +135,10 @@ class SimpleFix(fixer_base.BaseFix): self.assertEqual(fixes, [no_head]) def test_fixer_loading(self): - from myfixes.fix_first import FixFirst - from myfixes.fix_last import FixLast - from myfixes.fix_parrot import FixParrot - from myfixes.fix_preorder import FixPreorder + from .data.fixers.myfixes.fix_first import FixFirst + from .data.fixers.myfixes.fix_last import FixLast + from .data.fixers.myfixes.fix_parrot import FixParrot + from .data.fixers.myfixes.fix_preorder import FixPreorder rt = self.rt() pre, post = rt.get_fixers() @@ -324,12 +324,12 @@ def test_refactor_docstring(self): self.assertNotEqual(out, doc) def test_explicit(self): - from myfixes.fix_explicit import FixExplicit + from .data.fixers.myfixes.fix_explicit import FixExplicit - rt = self.rt(fixers=["myfixes.fix_explicit"]) + rt = self.rt(fixers=[".data.fixers.myfixes.fix_explicit"]) self.assertEqual(len(rt.post_order), 0) - rt = self.rt(explicit=["myfixes.fix_explicit"]) + rt = self.rt(explicit=[".data.fixers.myfixes.fix_explicit"]) for fix in rt.post_order: if isinstance(fix, FixExplicit): break diff --git a/Lib/lib2to3/tests/test_util.py b/Lib/test/lib2to3_tests/test_util.py similarity index 100% rename from Lib/lib2to3/tests/test_util.py rename to Lib/test/lib2to3_tests/test_util.py diff --git a/Lib/tkinter/test/test_tkinter/__init__.py b/Lib/test/sqlite3_test/__init__.py similarity index 100% rename from Lib/tkinter/test/test_tkinter/__init__.py rename to Lib/test/sqlite3_test/__init__.py diff --git a/Lib/sqlite3/test/backup.py b/Lib/test/sqlite3_test/backup.py similarity index 100% rename from Lib/sqlite3/test/backup.py rename to Lib/test/sqlite3_test/backup.py diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/test/sqlite3_test/dbapi.py similarity index 100% rename from Lib/sqlite3/test/dbapi.py rename to Lib/test/sqlite3_test/dbapi.py diff --git a/Lib/sqlite3/test/dump.py b/Lib/test/sqlite3_test/dump.py similarity index 100% rename from Lib/sqlite3/test/dump.py rename to Lib/test/sqlite3_test/dump.py diff --git a/Lib/sqlite3/test/factory.py b/Lib/test/sqlite3_test/factory.py similarity index 100% rename from Lib/sqlite3/test/factory.py rename to Lib/test/sqlite3_test/factory.py diff --git a/Lib/sqlite3/test/hooks.py b/Lib/test/sqlite3_test/hooks.py similarity index 100% rename from Lib/sqlite3/test/hooks.py rename to Lib/test/sqlite3_test/hooks.py diff --git a/Lib/sqlite3/test/regression.py b/Lib/test/sqlite3_test/regression.py similarity index 100% rename from Lib/sqlite3/test/regression.py rename to Lib/test/sqlite3_test/regression.py diff --git a/Lib/sqlite3/test/transactions.py b/Lib/test/sqlite3_test/transactions.py similarity index 100% rename from Lib/sqlite3/test/transactions.py rename to Lib/test/sqlite3_test/transactions.py diff --git a/Lib/sqlite3/test/types.py b/Lib/test/sqlite3_test/types.py similarity index 100% rename from Lib/sqlite3/test/types.py rename to Lib/test/sqlite3_test/types.py diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/test/sqlite3_test/userfunctions.py similarity index 100% rename from Lib/sqlite3/test/userfunctions.py rename to Lib/test/sqlite3_test/userfunctions.py diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py index 68268992e9f98f..5a1d39754075e6 100644 --- a/Lib/test/test_ctypes.py +++ b/Lib/test/test_ctypes.py @@ -1,7 +1,7 @@ import unittest from test.support import import_module -ctypes_test = import_module('ctypes.test') +ctypes_test = import_module('Lib.test.ctypes_test') load_tests = ctypes_test.load_tests diff --git a/Lib/test/test_distutils.py b/Lib/test/test_distutils.py index a37f11791754d2..284c9f13f1499a 100644 --- a/Lib/test/test_distutils.py +++ b/Lib/test/test_distutils.py @@ -1,23 +1,23 @@ """Tests for distutils. -The tests for distutils are defined in the distutils.tests package; +The tests for distutils are defined in the Lib.test.distutils_tests package; the test_suite() function there returns a test suite that's ready to be run. """ -import distutils.tests +import Lib.test.distutils_tests as distutils_tests import test.support def test_main(): # used by regrtest - test.support.run_unittest(distutils.tests.test_suite()) + test.support.run_unittest(distutils_tests.test_suite()) test.support.reap_children() def load_tests(*_): # used by unittest - return distutils.tests.test_suite() + return distutils_tests.test_suite() if __name__ == "__main__": diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py index 5eaa5164d490a7..acd3757e270007 100644 --- a/Lib/test/test_lib2to3.py +++ b/Lib/test/test_lib2to3.py @@ -1,4 +1,4 @@ -from lib2to3.tests import load_tests +from Lib.test.lib2to3_tests import load_tests import unittest if __name__ == '__main__': diff --git a/Lib/test/test_sqlite.py b/Lib/test/test_sqlite.py index 9564da35193f1f..ea297d270f5699 100644 --- a/Lib/test/test_sqlite.py +++ b/Lib/test/test_sqlite.py @@ -5,7 +5,7 @@ import unittest import sqlite3 -from sqlite3.test import (dbapi, types, userfunctions, +from Lib.test.sqlite3_test import (dbapi, types, userfunctions, factory, transactions, hooks, regression, dump, backup) diff --git a/Lib/test/test_tk.py b/Lib/test/test_tk.py index 48cefd92e12162..e77ae8f28b4ec8 100644 --- a/Lib/test/test_tk.py +++ b/Lib/test/test_tk.py @@ -5,7 +5,7 @@ # Skip test if tk cannot be initialized. support.requires('gui') -from tkinter.test import runtktests +from Lib.test.tkinter_test import runtktests def test_main(): support.run_unittest( diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py index 462665db5f3e75..03b3811f19c43a 100644 --- a/Lib/test/test_ttk_guionly.py +++ b/Lib/test/test_ttk_guionly.py @@ -10,7 +10,7 @@ import tkinter from _tkinter import TclError from tkinter import ttk -from tkinter.test import runtktests +from Lib.test.tkinter_test import runtktests root = None try: diff --git a/Lib/test/test_ttk_textonly.py b/Lib/test/test_ttk_textonly.py index 7540a4310344c1..ac9c630f64b698 100644 --- a/Lib/test/test_ttk_textonly.py +++ b/Lib/test/test_ttk_textonly.py @@ -3,7 +3,7 @@ # Skip this test if _tkinter does not exist. support.import_module('_tkinter') -from tkinter.test import runtktests +from Lib.test.tkinter_test import runtktests def test_main(): support.run_unittest( diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index bfc3ded6f128da..17e67f059a7bf8 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -1,16 +1,15 @@ -import unittest.test - +import Lib.test.unittest_test as unittest_test from test import support def test_main(): # used by regrtest - support.run_unittest(unittest.test.suite()) + support.run_unittest(unittest_test.suite()) support.reap_children() def load_tests(*_): # used by unittest - return unittest.test.suite() + return unittest_test.suite() if __name__ == "__main__": test_main() diff --git a/Lib/tkinter/test/README b/Lib/test/tkinter_test/README similarity index 100% rename from Lib/tkinter/test/README rename to Lib/test/tkinter_test/README diff --git a/Lib/tkinter/test/test_ttk/__init__.py b/Lib/test/tkinter_test/__init__.py similarity index 100% rename from Lib/tkinter/test/test_ttk/__init__.py rename to Lib/test/tkinter_test/__init__.py diff --git a/Lib/tkinter/test/runtktests.py b/Lib/test/tkinter_test/runtktests.py similarity index 97% rename from Lib/tkinter/test/runtktests.py rename to Lib/test/tkinter_test/runtktests.py index 33dc54a1375bf8..5058fb1104a29c 100644 --- a/Lib/tkinter/test/runtktests.py +++ b/Lib/test/tkinter_test/runtktests.py @@ -45,7 +45,7 @@ def get_tests_modules(basepath=this_dir_path, gui=True, packages=None): try: yield importlib.import_module( ".%s.%s" % (pkg_name, name[:-len(py_ext)]), - "tkinter.test") + "Lib.test.tkinter_test") except test.support.ResourceDenied: if gui: raise diff --git a/Lib/tkinter/test/support.py b/Lib/test/tkinter_test/support.py similarity index 100% rename from Lib/tkinter/test/support.py rename to Lib/test/tkinter_test/support.py diff --git a/Lib/test/tkinter_test/test_tkinter/__init__.py b/Lib/test/tkinter_test/test_tkinter/__init__.py new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/Lib/tkinter/test/test_tkinter/test_font.py b/Lib/test/tkinter_test/test_tkinter/test_font.py similarity index 98% rename from Lib/tkinter/test/test_tkinter/test_font.py rename to Lib/test/tkinter_test/test_tkinter/test_font.py index a021ea336807bb..6ce622f2efa078 100644 --- a/Lib/tkinter/test/test_tkinter/test_font.py +++ b/Lib/test/tkinter_test/test_tkinter/test_font.py @@ -2,7 +2,7 @@ import tkinter from tkinter import font from test.support import requires, run_unittest, gc_collect, ALWAYS_EQ -from tkinter.test.support import AbstractTkTest +from Lib.test.tkinter_test.support import AbstractTkTest requires('gui') diff --git a/Lib/tkinter/test/test_tkinter/test_geometry_managers.py b/Lib/test/tkinter_test/test_tkinter/test_geometry_managers.py similarity index 99% rename from Lib/tkinter/test/test_tkinter/test_geometry_managers.py rename to Lib/test/tkinter_test/test_tkinter/test_geometry_managers.py index c645d430079a52..e5a08d0e8e6206 100644 --- a/Lib/tkinter/test/test_tkinter/test_geometry_managers.py +++ b/Lib/test/tkinter_test/test_tkinter/test_geometry_managers.py @@ -4,8 +4,8 @@ from tkinter import TclError from test.support import requires -from tkinter.test.support import pixels_conv, tcl_version, requires_tcl -from tkinter.test.widget_tests import AbstractWidgetTest +from Lib.test.tkinter_test.support import pixels_conv, tcl_version, requires_tcl +from Lib.test.tkinter_test.widget_tests import AbstractWidgetTest requires('gui') diff --git a/Lib/tkinter/test/test_tkinter/test_images.py b/Lib/test/tkinter_test/test_tkinter/test_images.py similarity index 99% rename from Lib/tkinter/test/test_tkinter/test_images.py rename to Lib/test/tkinter_test/test_tkinter/test_images.py index 2805d35a1f5b1b..1c77aae9b7bf9a 100644 --- a/Lib/tkinter/test/test_tkinter/test_images.py +++ b/Lib/test/tkinter_test/test_tkinter/test_images.py @@ -1,7 +1,7 @@ import unittest import tkinter from test import support -from tkinter.test.support import AbstractTkTest, requires_tcl +from Lib.test.tkinter_test.support import AbstractTkTest, requires_tcl support.requires('gui') diff --git a/Lib/tkinter/test/test_tkinter/test_loadtk.py b/Lib/test/tkinter_test/test_tkinter/test_loadtk.py similarity index 100% rename from Lib/tkinter/test/test_tkinter/test_loadtk.py rename to Lib/test/tkinter_test/test_tkinter/test_loadtk.py diff --git a/Lib/tkinter/test/test_tkinter/test_misc.py b/Lib/test/tkinter_test/test_tkinter/test_misc.py similarity index 99% rename from Lib/tkinter/test/test_tkinter/test_misc.py rename to Lib/test/tkinter_test/test_tkinter/test_misc.py index 1e089747a91ee5..a7c5cbd7e9b7e9 100644 --- a/Lib/tkinter/test/test_tkinter/test_misc.py +++ b/Lib/test/tkinter_test/test_tkinter/test_misc.py @@ -1,7 +1,7 @@ import unittest import tkinter from test import support -from tkinter.test.support import AbstractTkTest +from Lib.test.tkinter_test.support import AbstractTkTest support.requires('gui') diff --git a/Lib/tkinter/test/test_tkinter/test_text.py b/Lib/test/tkinter_test/test_tkinter/test_text.py similarity index 96% rename from Lib/tkinter/test/test_tkinter/test_text.py rename to Lib/test/tkinter_test/test_tkinter/test_text.py index 13b7c56a3978d9..ae6a071ed0b1bf 100644 --- a/Lib/tkinter/test/test_tkinter/test_text.py +++ b/Lib/test/tkinter_test/test_tkinter/test_text.py @@ -1,7 +1,7 @@ import unittest import tkinter from test.support import requires, run_unittest -from tkinter.test.support import AbstractTkTest +from Lib.test.tkinter_test.support import AbstractTkTest requires('gui') diff --git a/Lib/tkinter/test/test_tkinter/test_variables.py b/Lib/test/tkinter_test/test_tkinter/test_variables.py similarity index 100% rename from Lib/tkinter/test/test_tkinter/test_variables.py rename to Lib/test/tkinter_test/test_tkinter/test_variables.py diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/test/tkinter_test/test_tkinter/test_widgets.py similarity index 99% rename from Lib/tkinter/test/test_tkinter/test_widgets.py rename to Lib/test/tkinter_test/test_tkinter/test_widgets.py index 16e9d93944c205..263a076b2e8fbc 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/test/tkinter_test/test_tkinter/test_widgets.py @@ -5,9 +5,9 @@ import sys from test.support import requires -from tkinter.test.support import (tcl_version, requires_tcl, +from Lib.test.tkinter_test.support import (tcl_version, requires_tcl, get_tk_patchlevel, widget_eq) -from tkinter.test.widget_tests import ( +from Lib.test.tkinter_test.widget_tests import ( add_standard_options, noconv, pixels_round, AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests, setUpModule) diff --git a/Lib/test/tkinter_test/test_ttk/__init__.py b/Lib/test/tkinter_test/test_ttk/__init__.py new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/test/tkinter_test/test_ttk/test_extensions.py similarity index 99% rename from Lib/tkinter/test/test_ttk/test_extensions.py rename to Lib/test/tkinter_test/test_ttk/test_extensions.py index a45f882bb00d48..d8bf66cecaf023 100644 --- a/Lib/tkinter/test/test_ttk/test_extensions.py +++ b/Lib/test/tkinter_test/test_ttk/test_extensions.py @@ -3,7 +3,7 @@ import tkinter from tkinter import ttk from test.support import requires, run_unittest, swap_attr -from tkinter.test.support import AbstractTkTest, destroy_default_root +from Lib.test.tkinter_test.support import AbstractTkTest, destroy_default_root requires('gui') diff --git a/Lib/tkinter/test/test_ttk/test_functions.py b/Lib/test/tkinter_test/test_ttk/test_functions.py similarity index 100% rename from Lib/tkinter/test/test_ttk/test_functions.py rename to Lib/test/tkinter_test/test_ttk/test_functions.py diff --git a/Lib/tkinter/test/test_ttk/test_style.py b/Lib/test/tkinter_test/test_ttk/test_style.py similarity index 98% rename from Lib/tkinter/test/test_ttk/test_style.py rename to Lib/test/tkinter_test/test_ttk/test_style.py index 3537536d81bc56..46c6991dff971c 100644 --- a/Lib/tkinter/test/test_ttk/test_style.py +++ b/Lib/test/tkinter_test/test_ttk/test_style.py @@ -2,7 +2,7 @@ import tkinter from tkinter import ttk from test.support import requires, run_unittest -from tkinter.test.support import AbstractTkTest +from Lib.test.tkinter_test.support import AbstractTkTest requires('gui') diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/test/tkinter_test/test_ttk/test_widgets.py similarity index 99% rename from Lib/tkinter/test/test_ttk/test_widgets.py rename to Lib/test/tkinter_test/test_ttk/test_widgets.py index 2598bc67652075..03947e917d430b 100644 --- a/Lib/tkinter/test/test_ttk/test_widgets.py +++ b/Lib/test/tkinter_test/test_ttk/test_widgets.py @@ -4,10 +4,10 @@ from test.support import requires import sys -from tkinter.test.test_ttk.test_functions import MockTclObj -from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel, +from Lib.test.tkinter_test.test_ttk.test_functions import MockTclObj +from Lib.test.tkinter_test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel, simulate_mouse_click) -from tkinter.test.widget_tests import (add_standard_options, noconv, +from Lib.test.tkinter_test.widget_tests import (add_standard_options, noconv, AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests, setUpModule) diff --git a/Lib/tkinter/test/widget_tests.py b/Lib/test/tkinter_test/widget_tests.py similarity index 99% rename from Lib/tkinter/test/widget_tests.py rename to Lib/test/tkinter_test/widget_tests.py index b42ff52178f29e..9c83045d23e3fc 100644 --- a/Lib/tkinter/test/widget_tests.py +++ b/Lib/test/tkinter_test/widget_tests.py @@ -3,7 +3,7 @@ import unittest import sys import tkinter -from tkinter.test.support import (AbstractTkTest, tcl_version, requires_tcl, +from Lib.test.tkinter_test.support import (AbstractTkTest, tcl_version, requires_tcl, get_tk_patchlevel, pixels_conv, tcl_obj_eq) import test.support diff --git a/Lib/unittest/test/__init__.py b/Lib/test/unittest_test/__init__.py similarity index 77% rename from Lib/unittest/test/__init__.py rename to Lib/test/unittest_test/__init__.py index cdae8a7442785a..806bdcd866ac70 100644 --- a/Lib/unittest/test/__init__.py +++ b/Lib/test/unittest_test/__init__.py @@ -10,11 +10,11 @@ def suite(): suite = unittest.TestSuite() for fn in os.listdir(here): if fn.startswith("test") and fn.endswith(".py"): - modname = "unittest.test." + fn[:-3] + modname = "Lib.test.unittest_test." + fn[:-3] __import__(modname) module = sys.modules[modname] suite.addTest(loader.loadTestsFromModule(module)) - suite.addTest(loader.loadTestsFromName('unittest.test.testmock')) + suite.addTest(loader.loadTestsFromName('Lib.test.unittest_test.testmock')) return suite diff --git a/Lib/unittest/test/__main__.py b/Lib/test/unittest_test/__main__.py similarity index 100% rename from Lib/unittest/test/__main__.py rename to Lib/test/unittest_test/__main__.py diff --git a/Lib/unittest/test/_test_warnings.py b/Lib/test/unittest_test/_test_warnings.py similarity index 100% rename from Lib/unittest/test/_test_warnings.py rename to Lib/test/unittest_test/_test_warnings.py diff --git a/Lib/unittest/test/dummy.py b/Lib/test/unittest_test/dummy.py similarity index 100% rename from Lib/unittest/test/dummy.py rename to Lib/test/unittest_test/dummy.py diff --git a/Lib/unittest/test/support.py b/Lib/test/unittest_test/support.py similarity index 100% rename from Lib/unittest/test/support.py rename to Lib/test/unittest_test/support.py diff --git a/Lib/unittest/test/test_assertions.py b/Lib/test/unittest_test/test_assertions.py similarity index 100% rename from Lib/unittest/test/test_assertions.py rename to Lib/test/unittest_test/test_assertions.py diff --git a/Lib/unittest/test/test_async_case.py b/Lib/test/unittest_test/test_async_case.py similarity index 100% rename from Lib/unittest/test/test_async_case.py rename to Lib/test/unittest_test/test_async_case.py diff --git a/Lib/unittest/test/test_break.py b/Lib/test/unittest_test/test_break.py similarity index 100% rename from Lib/unittest/test/test_break.py rename to Lib/test/unittest_test/test_break.py diff --git a/Lib/unittest/test/test_case.py b/Lib/test/unittest_test/test_case.py similarity index 99% rename from Lib/unittest/test/test_case.py rename to Lib/test/unittest_test/test_case.py index f855c4dc00b316..1b5d05f07e48b6 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/test/unittest_test/test_case.py @@ -14,7 +14,7 @@ import unittest -from unittest.test.support import ( +from Lib.test.unittest_test.support import ( TestEquality, TestHashing, LoggingResult, LegacyLoggingResult, ResultWithNoStartTestRunStopTestRun ) diff --git a/Lib/unittest/test/test_discovery.py b/Lib/test/unittest_test/test_discovery.py similarity index 99% rename from Lib/unittest/test/test_discovery.py rename to Lib/test/unittest_test/test_discovery.py index 16e081e1fb76ec..fa4ee99dd36f13 100644 --- a/Lib/unittest/test/test_discovery.py +++ b/Lib/test/unittest_test/test_discovery.py @@ -9,7 +9,7 @@ import unittest import unittest.mock -import unittest.test +import Lib.test.unittest_test as unittest_test class TestableTestProgram(unittest.TestProgram): @@ -788,7 +788,7 @@ def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] - expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) + expectedPath = os.path.abspath(os.path.dirname(unittest_test.__file__)) self.wasRun = False def _find_tests(start_dir, pattern, namespace=None): @@ -796,7 +796,7 @@ def _find_tests(start_dir, pattern, namespace=None): self.assertEqual(start_dir, expectedPath) return tests loader._find_tests = _find_tests - suite = loader.discover('unittest.test') + suite = loader.discover('Lib.test.unittest_test') self.assertTrue(self.wasRun) self.assertEqual(suite._tests, tests) diff --git a/Lib/unittest/test/test_functiontestcase.py b/Lib/test/unittest_test/test_functiontestcase.py similarity index 98% rename from Lib/unittest/test/test_functiontestcase.py rename to Lib/test/unittest_test/test_functiontestcase.py index c5f2bcbe741b61..d3fa97977c89c7 100644 --- a/Lib/unittest/test/test_functiontestcase.py +++ b/Lib/test/unittest_test/test_functiontestcase.py @@ -1,6 +1,6 @@ import unittest -from unittest.test.support import LoggingResult +from Lib.test.unittest_test.support import LoggingResult class Test_FunctionTestCase(unittest.TestCase): diff --git a/Lib/unittest/test/test_loader.py b/Lib/test/unittest_test/test_loader.py similarity index 100% rename from Lib/unittest/test/test_loader.py rename to Lib/test/unittest_test/test_loader.py diff --git a/Lib/unittest/test/test_program.py b/Lib/test/unittest_test/test_program.py similarity index 96% rename from Lib/unittest/test/test_program.py rename to Lib/test/unittest_test/test_program.py index 4a62ae1b11306e..5776a1a620e716 100644 --- a/Lib/unittest/test/test_program.py +++ b/Lib/test/unittest_test/test_program.py @@ -5,7 +5,7 @@ import subprocess from test import support import unittest -import unittest.test +import Lib.test.unittest_test as unittest_test class Test_TestProgram(unittest.TestCase): @@ -14,7 +14,7 @@ def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] - expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) + expectedPath = os.path.abspath(os.path.dirname(unittest_test.__file__)) self.wasRun = False def _find_tests(start_dir, pattern): @@ -22,7 +22,7 @@ def _find_tests(start_dir, pattern): self.assertEqual(start_dir, expectedPath) return tests loader._find_tests = _find_tests - suite = loader.discover('unittest.test') + suite = loader.discover('Lib.test.unittest_test') self.assertTrue(self.wasRun) self.assertEqual(suite._tests, tests) @@ -81,10 +81,10 @@ def run(self, test): sys.argv = ['faketest'] runner = FakeRunner() program = unittest.TestProgram(testRunner=runner, exit=False, - defaultTest='unittest.test', + defaultTest='Lib.test.unittest_test', testLoader=self.FooBarLoader()) sys.argv = old_argv - self.assertEqual(('unittest.test',), program.testNames) + self.assertEqual(('Lib.test.unittest_test',), program.testNames) def test_defaultTest_with_iterable(self): class FakeRunner(object): @@ -97,10 +97,10 @@ def run(self, test): runner = FakeRunner() program = unittest.TestProgram( testRunner=runner, exit=False, - defaultTest=['unittest.test', 'unittest.test2'], + defaultTest=['Lib.test.unittest_test', 'unittest.test2'], testLoader=self.FooBarLoader()) sys.argv = old_argv - self.assertEqual(['unittest.test', 'unittest.test2'], + self.assertEqual(['Lib.test.unittest_test', 'unittest.test2'], program.testNames) def test_NonExit(self): diff --git a/Lib/unittest/test/test_result.py b/Lib/test/unittest_test/test_result.py similarity index 100% rename from Lib/unittest/test/test_result.py rename to Lib/test/unittest_test/test_result.py diff --git a/Lib/unittest/test/test_runner.py b/Lib/test/unittest_test/test_runner.py similarity index 99% rename from Lib/unittest/test/test_runner.py rename to Lib/test/unittest_test/test_runner.py index dd9a1b6d9aeddf..5103cca2916448 100644 --- a/Lib/unittest/test/test_runner.py +++ b/Lib/test/unittest_test/test_runner.py @@ -7,7 +7,7 @@ import unittest from unittest.case import _Outcome -from unittest.test.support import (LoggingResult, +from Lib.test.unittest_test.support import (LoggingResult, ResultWithNoStartTestRunStopTestRun) diff --git a/Lib/unittest/test/test_setups.py b/Lib/test/unittest_test/test_setups.py similarity index 100% rename from Lib/unittest/test/test_setups.py rename to Lib/test/unittest_test/test_setups.py diff --git a/Lib/unittest/test/test_skipping.py b/Lib/test/unittest_test/test_skipping.py similarity index 99% rename from Lib/unittest/test/test_skipping.py rename to Lib/test/unittest_test/test_skipping.py index 1c178a95f750ff..a7f1ef255f2534 100644 --- a/Lib/unittest/test/test_skipping.py +++ b/Lib/test/unittest_test/test_skipping.py @@ -1,6 +1,6 @@ import unittest -from unittest.test.support import LoggingResult +from Lib.test.unittest_test.support import LoggingResult class Test_TestSkipping(unittest.TestCase): diff --git a/Lib/unittest/test/test_suite.py b/Lib/test/unittest_test/test_suite.py similarity index 99% rename from Lib/unittest/test/test_suite.py rename to Lib/test/unittest_test/test_suite.py index 0551a16996723e..40d8e1efa1bc2d 100644 --- a/Lib/unittest/test/test_suite.py +++ b/Lib/test/unittest_test/test_suite.py @@ -3,7 +3,7 @@ import gc import sys import weakref -from unittest.test.support import LoggingResult, TestEquality +from Lib.test.unittest_test.support import LoggingResult, TestEquality ### Support code for Test_TestSuite diff --git a/Lib/unittest/test/testmock/__init__.py b/Lib/test/unittest_test/testmock/__init__.py similarity index 87% rename from Lib/unittest/test/testmock/__init__.py rename to Lib/test/unittest_test/testmock/__init__.py index 87d7ae994d5cd3..cb47140ad8ad07 100644 --- a/Lib/unittest/test/testmock/__init__.py +++ b/Lib/test/unittest_test/testmock/__init__.py @@ -10,7 +10,7 @@ def load_tests(*args): suite = unittest.TestSuite() for fn in os.listdir(here): if fn.startswith("test") and fn.endswith(".py"): - modname = "unittest.test.testmock." + fn[:-3] + modname = "." + fn[:-3] __import__(modname) module = sys.modules[modname] suite.addTest(loader.loadTestsFromModule(module)) diff --git a/Lib/unittest/test/testmock/__main__.py b/Lib/test/unittest_test/testmock/__main__.py similarity index 100% rename from Lib/unittest/test/testmock/__main__.py rename to Lib/test/unittest_test/testmock/__main__.py diff --git a/Lib/unittest/test/testmock/support.py b/Lib/test/unittest_test/testmock/support.py similarity index 100% rename from Lib/unittest/test/testmock/support.py rename to Lib/test/unittest_test/testmock/support.py diff --git a/Lib/unittest/test/testmock/testasync.py b/Lib/test/unittest_test/testmock/testasync.py similarity index 100% rename from Lib/unittest/test/testmock/testasync.py rename to Lib/test/unittest_test/testmock/testasync.py diff --git a/Lib/unittest/test/testmock/testcallable.py b/Lib/test/unittest_test/testmock/testcallable.py similarity index 98% rename from Lib/unittest/test/testmock/testcallable.py rename to Lib/test/unittest_test/testmock/testcallable.py index 5eadc007049400..60e48ec691d7ba 100644 --- a/Lib/unittest/test/testmock/testcallable.py +++ b/Lib/test/unittest_test/testmock/testcallable.py @@ -3,7 +3,7 @@ # http://www.voidspace.org.uk/python/mock/ import unittest -from unittest.test.testmock.support import is_instance, X, SomeClass +from Lib.test.unittest_test.testmock.support import is_instance, X, SomeClass from unittest.mock import ( Mock, MagicMock, NonCallableMagicMock, diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/test/unittest_test/testmock/testhelpers.py similarity index 100% rename from Lib/unittest/test/testmock/testhelpers.py rename to Lib/test/unittest_test/testmock/testhelpers.py diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/test/unittest_test/testmock/testmagicmethods.py similarity index 100% rename from Lib/unittest/test/testmock/testmagicmethods.py rename to Lib/test/unittest_test/testmock/testmagicmethods.py diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/test/unittest_test/testmock/testmock.py similarity index 100% rename from Lib/unittest/test/testmock/testmock.py rename to Lib/test/unittest_test/testmock/testmock.py diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/test/unittest_test/testmock/testpatch.py similarity index 98% rename from Lib/unittest/test/testmock/testpatch.py rename to Lib/test/unittest_test/testmock/testpatch.py index f1bc0e1cd40a27..9ac5272bda67ed 100644 --- a/Lib/unittest/test/testmock/testpatch.py +++ b/Lib/test/unittest_test/testmock/testpatch.py @@ -7,8 +7,8 @@ from collections import OrderedDict import unittest -from unittest.test.testmock import support -from unittest.test.testmock.support import SomeClass, is_instance +from Lib.test.unittest_test.testmock import support +from Lib.test.unittest_test.testmock.support import SomeClass, is_instance from test.test_importlib.util import uncache from unittest.mock import ( @@ -669,7 +669,7 @@ def test_patch_dict_decorator_resolution(self): # the new dictionary during function call original = support.target.copy() - @patch.dict('unittest.test.testmock.support.target', {'bar': 'BAR'}) + @patch.dict('Lib.test.unittest_test.testmock.support.target', {'bar': 'BAR'}) def test(): self.assertEqual(support.target, {'foo': 'BAZ', 'bar': 'BAR'}) @@ -1614,7 +1614,7 @@ def test_patch_with_spec_mock_repr(self): def test_patch_nested_autospec_repr(self): - with patch('unittest.test.testmock.support', autospec=True) as m: + with patch('Lib.test.unittest_test.testmock.support', autospec=True) as m: self.assertIn(" name='support.SomeClass.wibble()'", repr(m.SomeClass.wibble())) self.assertIn(" name='support.SomeClass().wibble()'", @@ -1881,7 +1881,7 @@ def foo(x=0): with patch.object(foo, '__module__', "testpatch2"): self.assertEqual(foo.__module__, "testpatch2") - self.assertEqual(foo.__module__, 'unittest.test.testmock.testpatch') + self.assertEqual(foo.__module__, 'Lib.test.unittest_test.testmock.testpatch') with patch.object(foo, '__annotations__', dict([('s', 1, )])): self.assertEqual(foo.__annotations__, dict([('s', 1, )])) @@ -1916,16 +1916,17 @@ def test_dotted_but_module_not_loaded(self): # This exercises the AttributeError branch of _dot_lookup. # make sure it's there - import unittest.test.testmock.support + import Lib.test.unittest_test.testmock.support + # now make sure it's not: with patch.dict('sys.modules'): - del sys.modules['unittest.test.testmock.support'] - del sys.modules['unittest.test.testmock'] - del sys.modules['unittest.test'] + del sys.modules['Lib.test.unittest_test.testmock.support'] + del sys.modules['Lib.test.unittest_test.testmock'] + del sys.modules['Lib.test.unittest_test'] del sys.modules['unittest'] # now make sure we can patch based on a dotted path: - @patch('unittest.test.testmock.support.X') + @patch('Lib.test.unittest_test.testmock.support.X') def test(mock): pass test() @@ -1937,7 +1938,7 @@ def test_invalid_target(self): def test_cant_set_kwargs_when_passing_a_mock(self): - @patch('unittest.test.testmock.support.X', new=object(), x=1) + @patch('Lib.test.unittest_test.testmock.support.X', new=object(), x=1) def test(): pass with self.assertRaises(TypeError): test() diff --git a/Lib/unittest/test/testmock/testsealable.py b/Lib/test/unittest_test/testmock/testsealable.py similarity index 100% rename from Lib/unittest/test/testmock/testsealable.py rename to Lib/test/unittest_test/testmock/testsealable.py diff --git a/Lib/unittest/test/testmock/testsentinel.py b/Lib/test/unittest_test/testmock/testsentinel.py similarity index 100% rename from Lib/unittest/test/testmock/testsentinel.py rename to Lib/test/unittest_test/testmock/testsentinel.py diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/test/unittest_test/testmock/testwith.py similarity index 100% rename from Lib/unittest/test/testmock/testwith.py rename to Lib/test/unittest_test/testmock/testwith.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 3d1381b895b2f6..d17ee765fa8dd2 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -1257,7 +1257,7 @@ def buildPython(): # fix _sysconfigdata # # TODO: make this more robust! test_sysconfig_module of - # distutils.tests.test_sysconfig.SysconfigTestCase tests that + # Lib.test.distutils_tests.test_sysconfig.SysconfigTestCase tests that # the output from get_config_var in both sysconfig and # distutils.sysconfig is exactly the same for both CFLAGS and # LDFLAGS. The fixing up is now complicated by the pretty diff --git a/Makefile.pre.in b/Makefile.pre.in index 3199a1aa02d65b..652ce1336372b6 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1322,8 +1322,8 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ - tkinter/test/test_ttk site-packages test \ +LIBSUBDIRS= tkinter test/tkinter_test test/tkinter_test/test_tkinter \ + test/tkinter_test/test_ttk site-packages test \ test/audiodata \ test/capath test/data \ test/cjkencodings test/decimaltestdata \ @@ -1388,14 +1388,14 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ email email/mime test/test_email test/test_email/data \ ensurepip ensurepip/_bundled \ html json test/test_json http dbm xmlrpc \ - sqlite3 sqlite3/test \ + sqlite3 test/sqlite3_test \ logging csv wsgiref urllib \ - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ - lib2to3/tests/data lib2to3/tests/data/fixers \ - lib2to3/tests/data/fixers/myfixes \ - ctypes ctypes/test ctypes/macholib \ + lib2to3 lib2to3/fixes lib2to3/pgen2 test/lib2to3_tests \ + test/lib2to3_tests/data test/lib2to3_tests/data/fixers \ + test/lib2to3_tests/data/fixers/myfixes \ + ctypes test/ctypes_test ctypes/macholib \ idlelib idlelib/Icons idlelib/idle_test \ - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ + distutils distutils/command test/distutils_test $(XMLLIBSUBDIRS) \ test/test_tools test/test_warnings test/test_warnings/data \ turtledemo \ multiprocessing multiprocessing/dummy \ diff --git a/Misc/NEWS.d/next/Tests/2020-02-16-21-51-45.bpo-10572.5jQ5N4.rst b/Misc/NEWS.d/next/Tests/2020-02-16-21-51-45.bpo-10572.5jQ5N4.rst new file mode 100644 index 00000000000000..8555a523dcc002 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-02-16-21-51-45.bpo-10572.5jQ5N4.rst @@ -0,0 +1 @@ +Moved these classes tests, `ctypes.test`, `distultils.tests`, `unittest.test`, `lib2to3.tests`, `sqlite3.test`, `tkinter.test` to be in one unified location under `Lib/test/MODULE_NAME_test` \ No newline at end of file