Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-10572: Move test sub-packages to Lib/test #18524

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
13c5b05
Hard reset + cherry piciking the changes.
idomic Feb 11, 2020
fdecdf0
📜🤖 Added by blurb_it.
blurb-it[bot] Feb 11, 2020
29d13c9
Added @vstinner News
idomic Feb 12, 2020
135259f
Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst
idomic Feb 13, 2020
794b948
Merge branch 'master' of https://github.com/python/cpython
idomic Feb 15, 2020
bfa3cd1
Merge branch 'master' of https://github.com/python/cpython
idomic Feb 16, 2020
36b41eb
[bpo-10572] Moved tests of these modules under Lib/tests/MODULE_NAME_…
idomic Feb 16, 2020
69ad225
[bpo-10572] Changing test references for CI
idomic Feb 16, 2020
8e7db7a
[bpo-10572] Adapting tests imports
idomic Feb 16, 2020
71b4de5
Merge branch 'master' of https://github.com/python/cpython
idomic Feb 16, 2020
4be42f0
Removed residues
idomic Feb 16, 2020
4a3cf9f
Merge branch 'master' into bpo-10572-reArranging_Lib_tests
idomic Feb 16, 2020
18c5f36
[bpo-10572] Changed Makefile.pre.in to contain the correct tests path
idomic Feb 16, 2020
60a14df
📜🤖 Added by blurb_it.
blurb-it[bot] Feb 16, 2020
fbd63a8
[bpo-10572] Changed Makefile.pre.in to contain the correct tests path
idomic Feb 16, 2020
e3ff1cd
Merge remote-tracking branch 'origin/bpo-10572-reArranging_Lib_tests'…
idomic Feb 16, 2020
bb4e8b8
[bpo-10572] Changed Makefile.pre.in to contain the correct tests path
idomic Feb 16, 2020
65db1d2
[bpo-10572] Fixing distutils tests path
idomic Feb 16, 2020
7cfa472
[bpo-10572] Fixing Lib.test.tkinter_test tests path
idomic Feb 16, 2020
fd7ed2b
[bpo-10572] Fixing Lib.test.unittest_test + ctypes tests path
idomic Feb 16, 2020
6b32dd1
[bpo-10572] Fixing Lib.test.unittest_test + test_lib2to3 tests path
idomic Feb 17, 2020
1021fcf
[bpo-10572] Fixing Lib.test.unittest_test + test_lib2to3 tests path
idomic Feb 17, 2020
f5431d8
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
d89915f
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
a5e9500
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
19ab4cd
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
1010154
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
e65b43c
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
4609963
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
c552264
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Lib/ctypes/test/__main__.py

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions Lib/test/ctypes_test/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from Lib.test.ctypes_test import load_tests
import unittest

unittest.main()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
@@ -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__)
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
<ctypes.test.test_objects.X object at 0x...>
<Lib.test.ctypes_test.test_objects.X object at 0x...>
>>>

>>> x.array[0] = b'spam spam spam'
Expand All @@ -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)
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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())
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading