Skip to content

Commit d82e0bf

Browse files
authored
gh-93839: Move Lib/ctypes/test/ to Lib/test/test_ctypes/ (#94041)
* Move Lib/ctypes/test/ to Lib/test/test_ctypes/ * Remove Lib/test/test_ctypes.py * Update imports and build system.
1 parent 889772f commit d82e0bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+83
-93
lines changed

Lib/ctypes/test/__main__.py

-4
This file was deleted.

Lib/test/leakers/test_ctypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test().
2+
# Taken from Lib/test/test_ctypes/test_keeprefs.py, PointerToStructure.test().
33

44
from ctypes import Structure, c_int, POINTER
55
import gc

Lib/test/test_ctypes.py

-10
This file was deleted.
File renamed without changes.

Lib/test/test_ctypes/__main__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from test.test_ctypes import load_tests
2+
import unittest
3+
4+
unittest.main()
File renamed without changes.

Lib/ctypes/test/test_arrays.py Lib/test/test_ctypes/test_arrays.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
from ctypes import *
55

6-
from ctypes.test import need_symbol
6+
from test.test_ctypes import need_symbol
77

88
formats = "bBhHiIlLqQfd"
99

Lib/ctypes/test/test_as_parameter.py Lib/test/test_ctypes/test_as_parameter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
from ctypes import *
3-
from ctypes.test import need_symbol
3+
from test.test_ctypes import need_symbol
44
import _ctypes_test
55

66
dll = CDLL(_ctypes_test.__file__)

Lib/ctypes/test/test_bitfields.py Lib/test/test_ctypes/test_bitfields.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ctypes import *
2-
from ctypes.test import need_symbol
2+
from test.test_ctypes import need_symbol
33
from test import support
44
import unittest
55
import os

Lib/ctypes/test/test_buffers.py Lib/test/test_ctypes/test_buffers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ctypes import *
2-
from ctypes.test import need_symbol
2+
from test.test_ctypes import need_symbol
33
import unittest
44

55
class StringBufferTestCase(unittest.TestCase):
File renamed without changes.
File renamed without changes.

Lib/ctypes/test/test_callbacks.py Lib/test/test_ctypes/test_callbacks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from test import support
44

55
from ctypes import *
6-
from ctypes.test import need_symbol
6+
from test.test_ctypes import need_symbol
77
from _ctypes import CTYPES_MAX_ARGCOUNT
88
import _ctypes_test
99

Lib/ctypes/test/test_cast.py Lib/test/test_ctypes/test_cast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ctypes import *
2-
from ctypes.test import need_symbol
2+
from test.test_ctypes import need_symbol
33
import unittest
44
import sys
55

Lib/ctypes/test/test_cfuncs.py Lib/test/test_ctypes/test_cfuncs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import unittest
55
from ctypes import *
6-
from ctypes.test import need_symbol
6+
from test.test_ctypes import need_symbol
77

88
import _ctypes_test
99

Lib/ctypes/test/test_checkretval.py Lib/test/test_ctypes/test_checkretval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22

33
from ctypes import *
4-
from ctypes.test import need_symbol
4+
from test.test_ctypes import need_symbol
55

66
class CHECKED(c_int):
77
def _check_retval_(value):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Lib/ctypes/test/test_functions.py Lib/test/test_ctypes/test_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
from ctypes import *
9-
from ctypes.test import need_symbol
9+
from test.test_ctypes import need_symbol
1010
import sys, unittest
1111

1212
try:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Lib/ctypes/test/test_memfunctions.py Lib/test/test_ctypes/test_memfunctions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from test import support
33
import unittest
44
from ctypes import *
5-
from ctypes.test import need_symbol
5+
from test.test_ctypes import need_symbol
66

77
class MemFunctionsTest(unittest.TestCase):
88
@unittest.skip('test disabled')
File renamed without changes.

Lib/ctypes/test/test_objects.py Lib/test/test_ctypes/test_objects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
of 'x' ('_b_base_' is either None, or the root object owning the memory block):
4343
4444
>>> print(x.array._b_base_) # doctest: +ELLIPSIS
45-
<ctypes.test.test_objects.X object at 0x...>
45+
<test.test_ctypes.test_objects.X object at 0x...>
4646
>>>
4747
4848
>>> x.array[0] = b'spam spam spam'
@@ -56,12 +56,12 @@
5656

5757
import unittest, doctest
5858

59-
import ctypes.test.test_objects
59+
import test.test_ctypes.test_objects
6060

6161
class TestCase(unittest.TestCase):
6262
def test(self):
63-
failures, tests = doctest.testmod(ctypes.test.test_objects)
63+
failures, tests = doctest.testmod(test.test_ctypes.test_objects)
6464
self.assertFalse(failures, 'doctests failed, see output above')
6565

6666
if __name__ == '__main__':
67-
doctest.testmod(ctypes.test.test_objects)
67+
doctest.testmod(test.test_ctypes.test_objects)

Lib/ctypes/test/test_parameters.py Lib/test/test_ctypes/test_parameters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from ctypes.test import need_symbol
2+
from test.test_ctypes import need_symbol
33
import test.support
44

55
class SimpleTypesTestCase(unittest.TestCase):
File renamed without changes.
File renamed without changes.
File renamed without changes.

Lib/ctypes/test/test_prototypes.py Lib/test/test_ctypes/test_prototypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ctypes import *
2-
from ctypes.test import need_symbol
2+
from test.test_ctypes import need_symbol
33
import unittest
44

55
# IMPORTANT INFO:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Lib/ctypes/test/test_slicing.py Lib/test/test_ctypes/test_slicing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
from ctypes import *
3-
from ctypes.test import need_symbol
3+
from test.test_ctypes import need_symbol
44

55
import _ctypes_test
66

File renamed without changes.

Lib/ctypes/test/test_strings.py Lib/test/test_ctypes/test_strings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
from ctypes import *
3-
from ctypes.test import need_symbol
3+
from test.test_ctypes import need_symbol
44

55
class StringArrayTestCase(unittest.TestCase):
66
def test(self):

Lib/ctypes/test/test_structures.py Lib/test/test_ctypes/test_structures.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
import unittest
44
from ctypes import *
5-
from ctypes.test import need_symbol
5+
from test.test_ctypes import need_symbol
66
from struct import calcsize
77
import _ctypes_test
88
from test import support

Lib/ctypes/test/test_unicode.py Lib/test/test_ctypes/test_unicode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
import ctypes
3-
from ctypes.test import need_symbol
3+
from test.test_ctypes import need_symbol
44

55
import _ctypes_test
66

File renamed without changes.
File renamed without changes.
File renamed without changes.

Makefile.pre.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1918,8 +1918,7 @@ LIBSUBDIRS= asyncio \
19181918
xmlrpc \
19191919
zoneinfo \
19201920
__phello__
1921-
TESTSUBDIRS= ctypes/test \
1922-
distutils/tests \
1921+
TESTSUBDIRS= distutils/tests \
19231922
idlelib/idle_test \
19241923
lib2to3/tests \
19251924
lib2to3/tests/data \
@@ -1933,6 +1932,7 @@ TESTSUBDIRS= ctypes/test \
19331932
test/libregrtest test/sndhdrdata \
19341933
test/subprocessdata test/support \
19351934
test/test_asyncio \
1935+
test/test_ctypes \
19361936
test/test_email test/test_email/data \
19371937
test/test_import \
19381938
test/test_import/data \

PCbuild/lib.pyproj

+54-55
Original file line numberDiff line numberDiff line change
@@ -83,59 +83,6 @@
8383
<Compile Include="ctypes\macholib\dylib.py" />
8484
<Compile Include="ctypes\macholib\framework.py" />
8585
<Compile Include="ctypes\macholib\__init__.py" />
86-
<Compile Include="ctypes\test\test_anon.py" />
87-
<Compile Include="ctypes\test\test_arrays.py" />
88-
<Compile Include="ctypes\test\test_array_in_pointer.py" />
89-
<Compile Include="ctypes\test\test_as_parameter.py" />
90-
<Compile Include="ctypes\test\test_bitfields.py" />
91-
<Compile Include="ctypes\test\test_buffers.py" />
92-
<Compile Include="ctypes\test\test_bytes.py" />
93-
<Compile Include="ctypes\test\test_byteswap.py" />
94-
<Compile Include="ctypes\test\test_callbacks.py" />
95-
<Compile Include="ctypes\test\test_cast.py" />
96-
<Compile Include="ctypes\test\test_cfuncs.py" />
97-
<Compile Include="ctypes\test\test_checkretval.py" />
98-
<Compile Include="ctypes\test\test_delattr.py" />
99-
<Compile Include="ctypes\test\test_errno.py" />
100-
<Compile Include="ctypes\test\test_find.py" />
101-
<Compile Include="ctypes\test\test_frombuffer.py" />
102-
<Compile Include="ctypes\test\test_funcptr.py" />
103-
<Compile Include="ctypes\test\test_functions.py" />
104-
<Compile Include="ctypes\test\test_incomplete.py" />
105-
<Compile Include="ctypes\test\test_init.py" />
106-
<Compile Include="ctypes\test\test_internals.py" />
107-
<Compile Include="ctypes\test\test_keeprefs.py" />
108-
<Compile Include="ctypes\test\test_libc.py" />
109-
<Compile Include="ctypes\test\test_loading.py" />
110-
<Compile Include="ctypes\test\test_macholib.py" />
111-
<Compile Include="ctypes\test\test_memfunctions.py" />
112-
<Compile Include="ctypes\test\test_numbers.py" />
113-
<Compile Include="ctypes\test\test_objects.py" />
114-
<Compile Include="ctypes\test\test_parameters.py" />
115-
<Compile Include="ctypes\test\test_pep3118.py" />
116-
<Compile Include="ctypes\test\test_pickling.py" />
117-
<Compile Include="ctypes\test\test_pointers.py" />
118-
<Compile Include="ctypes\test\test_prototypes.py" />
119-
<Compile Include="ctypes\test\test_python_api.py" />
120-
<Compile Include="ctypes\test\test_random_things.py" />
121-
<Compile Include="ctypes\test\test_refcounts.py" />
122-
<Compile Include="ctypes\test\test_repr.py" />
123-
<Compile Include="ctypes\test\test_returnfuncptrs.py" />
124-
<Compile Include="ctypes\test\test_simplesubclasses.py" />
125-
<Compile Include="ctypes\test\test_sizes.py" />
126-
<Compile Include="ctypes\test\test_slicing.py" />
127-
<Compile Include="ctypes\test\test_stringptr.py" />
128-
<Compile Include="ctypes\test\test_strings.py" />
129-
<Compile Include="ctypes\test\test_structures.py" />
130-
<Compile Include="ctypes\test\test_struct_fields.py" />
131-
<Compile Include="ctypes\test\test_unaligned_structures.py" />
132-
<Compile Include="ctypes\test\test_unicode.py" />
133-
<Compile Include="ctypes\test\test_values.py" />
134-
<Compile Include="ctypes\test\test_varsize_struct.py" />
135-
<Compile Include="ctypes\test\test_win32.py" />
136-
<Compile Include="ctypes\test\test_wintypes.py" />
137-
<Compile Include="ctypes\test\__init__.py" />
138-
<Compile Include="ctypes\test\__main__.py" />
13986
<Compile Include="ctypes\util.py" />
14087
<Compile Include="ctypes\wintypes.py" />
14188
<Compile Include="ctypes\_endian.py" />
@@ -944,7 +891,59 @@
944891
<Compile Include="test\test_crashers.py" />
945892
<Compile Include="test\test_crypt.py" />
946893
<Compile Include="test\test_csv.py" />
947-
<Compile Include="test\test_ctypes.py" />
894+
<Compile Include="test\test_ctypes\test_anon.py" />
895+
<Compile Include="test\test_ctypes\test_arrays.py" />
896+
<Compile Include="test\test_ctypes\test_array_in_pointer.py" />
897+
<Compile Include="test\test_ctypes\test_as_parameter.py" />
898+
<Compile Include="test\test_ctypes\test_bitfields.py" />
899+
<Compile Include="test\test_ctypes\test_buffers.py" />
900+
<Compile Include="test\test_ctypes\test_bytes.py" />
901+
<Compile Include="test\test_ctypes\test_byteswap.py" />
902+
<Compile Include="test\test_ctypes\test_callbacks.py" />
903+
<Compile Include="test\test_ctypes\test_cast.py" />
904+
<Compile Include="test\test_ctypes\test_cfuncs.py" />
905+
<Compile Include="test\test_ctypes\test_checkretval.py" />
906+
<Compile Include="test\test_ctypes\test_delattr.py" />
907+
<Compile Include="test\test_ctypes\test_errno.py" />
908+
<Compile Include="test\test_ctypes\test_find.py" />
909+
<Compile Include="test\test_ctypes\test_frombuffer.py" />
910+
<Compile Include="test\test_ctypes\test_funcptr.py" />
911+
<Compile Include="test\test_ctypes\test_functions.py" />
912+
<Compile Include="test\test_ctypes\test_incomplete.py" />
913+
<Compile Include="test\test_ctypes\test_init.py" />
914+
<Compile Include="test\test_ctypes\test_internals.py" />
915+
<Compile Include="test\test_ctypes\test_keeprefs.py" />
916+
<Compile Include="test\test_ctypes\test_libc.py" />
917+
<Compile Include="test\test_ctypes\test_loading.py" />
918+
<Compile Include="test\test_ctypes\test_macholib.py" />
919+
<Compile Include="test\test_ctypes\test_memfunctions.py" />
920+
<Compile Include="test\test_ctypes\test_numbers.py" />
921+
<Compile Include="test\test_ctypes\test_objects.py" />
922+
<Compile Include="test\test_ctypes\test_parameters.py" />
923+
<Compile Include="test\test_ctypes\test_pep3118.py" />
924+
<Compile Include="test\test_ctypes\test_pickling.py" />
925+
<Compile Include="test\test_ctypes\test_pointers.py" />
926+
<Compile Include="test\test_ctypes\test_prototypes.py" />
927+
<Compile Include="test\test_ctypes\test_python_api.py" />
928+
<Compile Include="test\test_ctypes\test_random_things.py" />
929+
<Compile Include="test\test_ctypes\test_refcounts.py" />
930+
<Compile Include="test\test_ctypes\test_repr.py" />
931+
<Compile Include="test\test_ctypes\test_returnfuncptrs.py" />
932+
<Compile Include="test\test_ctypes\test_simplesubclasses.py" />
933+
<Compile Include="test\test_ctypes\test_sizes.py" />
934+
<Compile Include="test\test_ctypes\test_slicing.py" />
935+
<Compile Include="test\test_ctypes\test_stringptr.py" />
936+
<Compile Include="test\test_ctypes\test_strings.py" />
937+
<Compile Include="test\test_ctypes\test_structures.py" />
938+
<Compile Include="test\test_ctypes\test_struct_fields.py" />
939+
<Compile Include="test\test_ctypes\test_unaligned_structures.py" />
940+
<Compile Include="test\test_ctypes\test_unicode.py" />
941+
<Compile Include="test\test_ctypes\test_values.py" />
942+
<Compile Include="test\test_ctypes\test_varsize_struct.py" />
943+
<Compile Include="test\test_ctypes\test_win32.py" />
944+
<Compile Include="test\test_ctypes\test_wintypes.py" />
945+
<Compile Include="test\test_ctypes\__init__.py" />
946+
<Compile Include="test\test_ctypes\__main__.py" />
948947
<Compile Include="test\test_curses.py" />
949948
<Compile Include="test\test_datetime.py" />
950949
<Compile Include="test\test_dbm.py" />
@@ -1725,7 +1724,6 @@
17251724
<Folder Include="concurrent\futures" />
17261725
<Folder Include="ctypes" />
17271726
<Folder Include="ctypes\macholib" />
1728-
<Folder Include="ctypes\test" />
17291727
<Folder Include="curses" />
17301728
<Folder Include="dbm" />
17311729
<Folder Include="distutils" />
@@ -1769,6 +1767,7 @@
17691767
<Folder Include="test\subprocessdata" />
17701768
<Folder Include="test\support" />
17711769
<Folder Include="test\test_asyncio" />
1770+
<Folder Include="test\test_ctypes" />
17721771
<Folder Include="test\test_email" />
17731772
<Folder Include="test\test_email\data" />
17741773
<Folder Include="test\test_import" />

Tools/wasm/wasm_assets.py

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111

112112
# regression test sub directories
113113
OMIT_SUBDIRS = (
114-
"ctypes/test/",
115114
"tkinter/test/",
116115
"unittest/test/",
117116
)

0 commit comments

Comments
 (0)