ENH Support SDL-based packages and add pyxel. ### Description

This adds SDL-based package support to Pyodide and adds pyxel as a PoC. Most of the troubleshooting is done by @kitao and pyxel devs, a big thanks to them.

This is on top of #3505

1) I linked only js part of SDL libraries to the main module and linked the native parts to the side module. So the size increase of the main module is small enough (~0.1MB increase to the pyodide.asm.js).

Before (in #3505):

```
5145705 pyodide.asm.data
1204075 pyodide.asm.js
8862216 pyodide.asm.wasm
```

After:

```
5145705 pyodide.asm.data
1346524 pyodide.asm.js
8905514 pyodide.asm.wasm
```

2) Emscripten draws everything into `Module.canvas`, but the canvas attribute is not set automatically (which makes sense as we don't output any HTML), so it is the user's job to set it manually.

For now, I am thinking of just mentioning it in the FAQ entry, "you need to set pyodide._module.canvas = ...". But it would be probably nice to have an API to set canvas, as pyodide._module is a private attribute.

### Checklists

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [x] Add / update tests
- [x] Add new / update outdated documentation

### Demo

https://ryanking13.github.io/pyodide-pyxel-test

(mostly borrowed from the pyxel repository: https://github.com/kitao/pyxel/tree/main/wasm)

From d82e0bfe8b98a122ca443b356d81998c804b686e Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@python.org>
Date: Tue, 21 Jun 2022 10:24:33 +0200
Subject: [PATCH 5/9] 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.
---
 Lib/ctypes/test/__main__.py                   |   4 -
 Lib/test/leakers/test_ctypes.py               |   2 +-
 Lib/test/test_ctypes.py                       |  10 --
 .../test => test/test_ctypes}/__init__.py     |   0
 Lib/test/test_ctypes/__main__.py              |   4 +
 .../test => test/test_ctypes}/test_anon.py    |   0
 .../test_ctypes}/test_array_in_pointer.py     |   0
 .../test => test/test_ctypes}/test_arrays.py  |   2 +-
 .../test_ctypes}/test_as_parameter.py         |   2 +-
 .../test_ctypes}/test_bitfields.py            |   2 +-
 .../test => test/test_ctypes}/test_buffers.py |   2 +-
 .../test => test/test_ctypes}/test_bytes.py   |   0
 .../test_ctypes}/test_byteswap.py             |   0
 .../test_ctypes}/test_callbacks.py            |   2 +-
 .../test => test/test_ctypes}/test_cast.py    |   2 +-
 .../test => test/test_ctypes}/test_cfuncs.py  |   2 +-
 .../test_ctypes}/test_checkretval.py          |   2 +-
 .../test => test/test_ctypes}/test_delattr.py |   0
 .../test => test/test_ctypes}/test_errno.py   |   0
 .../test => test/test_ctypes}/test_find.py    |   0
 .../test_ctypes}/test_frombuffer.py           |   0
 .../test => test/test_ctypes}/test_funcptr.py |   0
 .../test_ctypes}/test_functions.py            |   2 +-
 .../test_ctypes}/test_incomplete.py           |   0
 .../test => test/test_ctypes}/test_init.py    |   0
 .../test_ctypes}/test_internals.py            |   0
 .../test_ctypes}/test_keeprefs.py             |   0
 .../test => test/test_ctypes}/test_libc.py    |   0
 .../test => test/test_ctypes}/test_loading.py |   0
 .../test_ctypes}/test_macholib.py             |   0
 .../test_ctypes}/test_memfunctions.py         |   2 +-
 .../test => test/test_ctypes}/test_numbers.py |   0
 .../test => test/test_ctypes}/test_objects.py |   8 +-
 .../test_ctypes}/test_parameters.py           |   2 +-
 .../test => test/test_ctypes}/test_pep3118.py |   0
 .../test_ctypes}/test_pickling.py             |   0
 .../test_ctypes}/test_pointers.py             |   0
 .../test_ctypes}/test_prototypes.py           |   2 +-
 .../test_ctypes}/test_python_api.py           |   0
 .../test_ctypes}/test_random_things.py        |   0
 .../test_ctypes}/test_refcounts.py            |   0
 .../test => test/test_ctypes}/test_repr.py    |   0
 .../test_ctypes}/test_returnfuncptrs.py       |   0
 .../test_ctypes}/test_simplesubclasses.py     |   0
 .../test => test/test_ctypes}/test_sizes.py   |   0
 .../test => test/test_ctypes}/test_slicing.py |   2 +-
 .../test_ctypes}/test_stringptr.py            |   0
 .../test => test/test_ctypes}/test_strings.py |   2 +-
 .../test_ctypes}/test_struct_fields.py        |   0
 .../test_ctypes}/test_structures.py           |   2 +-
 .../test_ctypes}/test_unaligned_structures.py |   0
 .../test => test/test_ctypes}/test_unicode.py |   2 +-
 .../test => test/test_ctypes}/test_values.py  |   0
 .../test_ctypes}/test_varsize_struct.py       |   0
 .../test => test/test_ctypes}/test_win32.py   |   0
 .../test_ctypes}/test_wintypes.py             |   0
 Makefile.pre.in                               |   4 +-
 ...2-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst |   2 +
 PCbuild/lib.pyproj                            | 109 +++++++++---------
 Tools/wasm/wasm_assets.py                     |   1 -
 60 files changed, 83 insertions(+), 93 deletions(-)
 delete mode 100644 Lib/ctypes/test/__main__.py
 delete mode 100644 Lib/test/test_ctypes.py
 rename Lib/{ctypes/test => test/test_ctypes}/__init__.py (100%)
 create mode 100644 Lib/test/test_ctypes/__main__.py
 rename Lib/{ctypes/test => test/test_ctypes}/test_anon.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_array_in_pointer.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_arrays.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_as_parameter.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_bitfields.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_buffers.py (98%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_bytes.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_byteswap.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_callbacks.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_cast.py (98%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_cfuncs.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_checkretval.py (95%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_delattr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_errno.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_find.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_frombuffer.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_funcptr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_functions.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_incomplete.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_init.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_internals.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_keeprefs.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_libc.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_loading.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_macholib.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_memfunctions.py (98%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_numbers.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_objects.py (87%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_parameters.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_pep3118.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_pickling.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_pointers.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_prototypes.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_python_api.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_random_things.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_refcounts.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_repr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_returnfuncptrs.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_simplesubclasses.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_sizes.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_slicing.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_stringptr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_strings.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_struct_fields.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_structures.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_unaligned_structures.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_unicode.py (97%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_values.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_varsize_struct.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_win32.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_wintypes.py (100%)
 create mode 100644 Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst

diff --git a/Lib/ctypes/test/__main__.py b/Lib/ctypes/test/__main__.py
deleted file mode 100644
index 362a9ec8cf..0000000000
--- 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/test/leakers/test_ctypes.py b/Lib/test/leakers/test_ctypes.py
index 7d7e9ff3a1..ec09ac3699 100644
--- a/Lib/test/leakers/test_ctypes.py
+++ b/Lib/test/leakers/test_ctypes.py
@@ -1,5 +1,5 @@
 
-# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test().
+# Taken from Lib/test/test_ctypes/test_keeprefs.py, PointerToStructure.test().
 
 from ctypes import Structure, c_int, POINTER
 import gc
diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py
deleted file mode 100644
index b0a12c9734..0000000000
--- a/Lib/test/test_ctypes.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import unittest
-from test.support.import_helper import import_module
-
-
-ctypes_test = import_module('ctypes.test')
-
-load_tests = ctypes_test.load_tests
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/Lib/ctypes/test/__init__.py b/Lib/test/test_ctypes/__init__.py
similarity index 100%
rename from Lib/ctypes/test/__init__.py
rename to Lib/test/test_ctypes/__init__.py
diff --git a/Lib/test/test_ctypes/__main__.py b/Lib/test/test_ctypes/__main__.py
new file mode 100644
index 0000000000..3003d4db89
--- /dev/null
+++ b/Lib/test/test_ctypes/__main__.py
@@ -0,0 +1,4 @@
+from test.test_ctypes import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/ctypes/test/test_anon.py b/Lib/test/test_ctypes/test_anon.py
similarity index 100%
rename from Lib/ctypes/test/test_anon.py
rename to Lib/test/test_ctypes/test_anon.py
diff --git a/Lib/ctypes/test/test_array_in_pointer.py b/Lib/test/test_ctypes/test_array_in_pointer.py
similarity index 100%
rename from Lib/ctypes/test/test_array_in_pointer.py
rename to Lib/test/test_ctypes/test_array_in_pointer.py
diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/test/test_ctypes/test_arrays.py
similarity index 99%
rename from Lib/ctypes/test/test_arrays.py
rename to Lib/test/test_ctypes/test_arrays.py
index 14603b7049..415a5785a9 100644
--- a/Lib/ctypes/test/test_arrays.py
+++ b/Lib/test/test_ctypes/test_arrays.py
@@ -3,7 +3,7 @@
 import sys
 from ctypes import *
 
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 formats = "bBhHiIlLqQfd"
 
diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py
similarity index 99%
rename from Lib/ctypes/test/test_as_parameter.py
rename to Lib/test/test_ctypes/test_as_parameter.py
index f9d27cb89d..b35defb158 100644
--- a/Lib/ctypes/test/test_as_parameter.py
+++ b/Lib/test/test_ctypes/test_as_parameter.py
@@ -1,6 +1,6 @@
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import _ctypes_test
 
 dll = CDLL(_ctypes_test.__file__)
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/test/test_ctypes/test_bitfields.py
similarity index 99%
rename from Lib/ctypes/test/test_bitfields.py
rename to Lib/test/test_ctypes/test_bitfields.py
index 66acd62e68..dad71a0ba7 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/test/test_ctypes/test_bitfields.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 from test import support
 import unittest
 import os
diff --git a/Lib/ctypes/test/test_buffers.py b/Lib/test/test_ctypes/test_buffers.py
similarity index 98%
rename from Lib/ctypes/test/test_buffers.py
rename to Lib/test/test_ctypes/test_buffers.py
index 15782be757..a9be2023aa 100644
--- a/Lib/ctypes/test/test_buffers.py
+++ b/Lib/test/test_ctypes/test_buffers.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import unittest
 
 class StringBufferTestCase(unittest.TestCase):
diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/test/test_ctypes/test_bytes.py
similarity index 100%
rename from Lib/ctypes/test/test_bytes.py
rename to Lib/test/test_ctypes/test_bytes.py
diff --git a/Lib/ctypes/test/test_byteswap.py b/Lib/test/test_ctypes/test_byteswap.py
similarity index 100%
rename from Lib/ctypes/test/test_byteswap.py
rename to Lib/test/test_ctypes/test_byteswap.py
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/test/test_ctypes/test_callbacks.py
similarity index 99%
rename from Lib/ctypes/test/test_callbacks.py
rename to Lib/test/test_ctypes/test_callbacks.py
index 1099cf9a69..2758720d4a 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/test/test_ctypes/test_callbacks.py
@@ -3,7 +3,7 @@
 from test import support
 
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 from _ctypes import CTYPES_MAX_ARGCOUNT
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_cast.py b/Lib/test/test_ctypes/test_cast.py
similarity index 98%
rename from Lib/ctypes/test/test_cast.py
rename to Lib/test/test_ctypes/test_cast.py
index 6878f97328..7ee23b16f1 100644
--- a/Lib/ctypes/test/test_cast.py
+++ b/Lib/test/test_ctypes/test_cast.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import unittest
 import sys
 
diff --git a/Lib/ctypes/test/test_cfuncs.py b/Lib/test/test_ctypes/test_cfuncs.py
similarity index 99%
rename from Lib/ctypes/test/test_cfuncs.py
rename to Lib/test/test_ctypes/test_cfuncs.py
index ac2240fa19..0a9394bf31 100644
--- a/Lib/ctypes/test/test_cfuncs.py
+++ b/Lib/test/test_ctypes/test_cfuncs.py
@@ -3,7 +3,7 @@
 
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/test/test_ctypes/test_checkretval.py
similarity index 95%
rename from Lib/ctypes/test/test_checkretval.py
rename to Lib/test/test_ctypes/test_checkretval.py
index e9567dc391..1492099f4b 100644
--- a/Lib/ctypes/test/test_checkretval.py
+++ b/Lib/test/test_ctypes/test_checkretval.py
@@ -1,7 +1,7 @@
 import unittest
 
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 class CHECKED(c_int):
     def _check_retval_(value):
diff --git a/Lib/ctypes/test/test_delattr.py b/Lib/test/test_ctypes/test_delattr.py
similarity index 100%
rename from Lib/ctypes/test/test_delattr.py
rename to Lib/test/test_ctypes/test_delattr.py
diff --git a/Lib/ctypes/test/test_errno.py b/Lib/test/test_ctypes/test_errno.py
similarity index 100%
rename from Lib/ctypes/test/test_errno.py
rename to Lib/test/test_ctypes/test_errno.py
diff --git a/Lib/ctypes/test/test_find.py b/Lib/test/test_ctypes/test_find.py
similarity index 100%
rename from Lib/ctypes/test/test_find.py
rename to Lib/test/test_ctypes/test_find.py
diff --git a/Lib/ctypes/test/test_frombuffer.py b/Lib/test/test_ctypes/test_frombuffer.py
similarity index 100%
rename from Lib/ctypes/test/test_frombuffer.py
rename to Lib/test/test_ctypes/test_frombuffer.py
diff --git a/Lib/ctypes/test/test_funcptr.py b/Lib/test/test_ctypes/test_funcptr.py
similarity index 100%
rename from Lib/ctypes/test/test_funcptr.py
rename to Lib/test/test_ctypes/test_funcptr.py
diff --git a/Lib/ctypes/test/test_functions.py b/Lib/test/test_ctypes/test_functions.py
similarity index 99%
rename from Lib/ctypes/test/test_functions.py
rename to Lib/test/test_ctypes/test_functions.py
index f9e92e1cc6..4a784c8d79 100644
--- a/Lib/ctypes/test/test_functions.py
+++ b/Lib/test/test_ctypes/test_functions.py
@@ -6,7 +6,7 @@
 """
 
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import sys, unittest
 
 try:
diff --git a/Lib/ctypes/test/test_incomplete.py b/Lib/test/test_ctypes/test_incomplete.py
similarity index 100%
rename from Lib/ctypes/test/test_incomplete.py
rename to Lib/test/test_ctypes/test_incomplete.py
diff --git a/Lib/ctypes/test/test_init.py b/Lib/test/test_ctypes/test_init.py
similarity index 100%
rename from Lib/ctypes/test/test_init.py
rename to Lib/test/test_ctypes/test_init.py
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/test/test_ctypes/test_internals.py
similarity index 100%
rename from Lib/ctypes/test/test_internals.py
rename to Lib/test/test_ctypes/test_internals.py
diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/test/test_ctypes/test_keeprefs.py
similarity index 100%
rename from Lib/ctypes/test/test_keeprefs.py
rename to Lib/test/test_ctypes/test_keeprefs.py
diff --git a/Lib/ctypes/test/test_libc.py b/Lib/test/test_ctypes/test_libc.py
similarity index 100%
rename from Lib/ctypes/test/test_libc.py
rename to Lib/test/test_ctypes/test_libc.py
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/test/test_ctypes/test_loading.py
similarity index 100%
rename from Lib/ctypes/test/test_loading.py
rename to Lib/test/test_ctypes/test_loading.py
diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/test/test_ctypes/test_macholib.py
similarity index 100%
rename from Lib/ctypes/test/test_macholib.py
rename to Lib/test/test_ctypes/test_macholib.py
diff --git a/Lib/ctypes/test/test_memfunctions.py b/Lib/test/test_ctypes/test_memfunctions.py
similarity index 98%
rename from Lib/ctypes/test/test_memfunctions.py
rename to Lib/test/test_ctypes/test_memfunctions.py
index e784b9a706..d5c9735211 100644
--- a/Lib/ctypes/test/test_memfunctions.py
+++ b/Lib/test/test_ctypes/test_memfunctions.py
@@ -2,7 +2,7 @@
 from test import support
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 class MemFunctionsTest(unittest.TestCase):
     @unittest.skip('test disabled')
diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/test/test_ctypes/test_numbers.py
similarity index 100%
rename from Lib/ctypes/test/test_numbers.py
rename to Lib/test/test_ctypes/test_numbers.py
diff --git a/Lib/ctypes/test/test_objects.py b/Lib/test/test_ctypes/test_objects.py
similarity index 87%
rename from Lib/ctypes/test/test_objects.py
rename to Lib/test/test_ctypes/test_objects.py
index 19e3dc1f2d..44a3c61ad7 100644
--- a/Lib/ctypes/test/test_objects.py
+++ b/Lib/test/test_ctypes/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
-<ctypes.test.test_objects.X object at 0x...>
+<test.test_ctypes.test_objects.X object at 0x...>
 >>>
 
 >>> x.array[0] = b'spam spam spam'
@@ -56,12 +56,12 @@
 
 import unittest, doctest
 
-import ctypes.test.test_objects
+import test.test_ctypes.test_objects
 
 class TestCase(unittest.TestCase):
     def test(self):
-        failures, tests = doctest.testmod(ctypes.test.test_objects)
+        failures, tests = doctest.testmod(test.test_ctypes.test_objects)
         self.assertFalse(failures, 'doctests failed, see output above')
 
 if __name__ == '__main__':
-    doctest.testmod(ctypes.test.test_objects)
+    doctest.testmod(test.test_ctypes.test_objects)
diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/test/test_ctypes/test_parameters.py
similarity index 99%
rename from Lib/ctypes/test/test_parameters.py
rename to Lib/test/test_ctypes/test_parameters.py
index 38af7ac13d..2f755a6d09 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/test/test_ctypes/test_parameters.py
@@ -1,5 +1,5 @@
 import unittest
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import test.support
 
 class SimpleTypesTestCase(unittest.TestCase):
diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/test/test_ctypes/test_pep3118.py
similarity index 100%
rename from Lib/ctypes/test/test_pep3118.py
rename to Lib/test/test_ctypes/test_pep3118.py
diff --git a/Lib/ctypes/test/test_pickling.py b/Lib/test/test_ctypes/test_pickling.py
similarity index 100%
rename from Lib/ctypes/test/test_pickling.py
rename to Lib/test/test_ctypes/test_pickling.py
diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/test/test_ctypes/test_pointers.py
similarity index 100%
rename from Lib/ctypes/test/test_pointers.py
rename to Lib/test/test_ctypes/test_pointers.py
diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/test/test_ctypes/test_prototypes.py
similarity index 99%
rename from Lib/ctypes/test/test_prototypes.py
rename to Lib/test/test_ctypes/test_prototypes.py
index cd0c649de3..bf27561487 100644
--- a/Lib/ctypes/test/test_prototypes.py
+++ b/Lib/test/test_ctypes/test_prototypes.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import unittest
 
 # IMPORTANT INFO:
diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/test/test_ctypes/test_python_api.py
similarity index 100%
rename from Lib/ctypes/test/test_python_api.py
rename to Lib/test/test_ctypes/test_python_api.py
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/test/test_ctypes/test_random_things.py
similarity index 100%
rename from Lib/ctypes/test/test_random_things.py
rename to Lib/test/test_ctypes/test_random_things.py
diff --git a/Lib/ctypes/test/test_refcounts.py b/Lib/test/test_ctypes/test_refcounts.py
similarity index 100%
rename from Lib/ctypes/test/test_refcounts.py
rename to Lib/test/test_ctypes/test_refcounts.py
diff --git a/Lib/ctypes/test/test_repr.py b/Lib/test/test_ctypes/test_repr.py
similarity index 100%
rename from Lib/ctypes/test/test_repr.py
rename to Lib/test/test_ctypes/test_repr.py
diff --git a/Lib/ctypes/test/test_returnfuncptrs.py b/Lib/test/test_ctypes/test_returnfuncptrs.py
similarity index 100%
rename from Lib/ctypes/test/test_returnfuncptrs.py
rename to Lib/test/test_ctypes/test_returnfuncptrs.py
diff --git a/Lib/ctypes/test/test_simplesubclasses.py b/Lib/test/test_ctypes/test_simplesubclasses.py
similarity index 100%
rename from Lib/ctypes/test/test_simplesubclasses.py
rename to Lib/test/test_ctypes/test_simplesubclasses.py
diff --git a/Lib/ctypes/test/test_sizes.py b/Lib/test/test_ctypes/test_sizes.py
similarity index 100%
rename from Lib/ctypes/test/test_sizes.py
rename to Lib/test/test_ctypes/test_sizes.py
diff --git a/Lib/ctypes/test/test_slicing.py b/Lib/test/test_ctypes/test_slicing.py
similarity index 99%
rename from Lib/ctypes/test/test_slicing.py
rename to Lib/test/test_ctypes/test_slicing.py
index a3932f1767..b3e68f9a82 100644
--- a/Lib/ctypes/test/test_slicing.py
+++ b/Lib/test/test_ctypes/test_slicing.py
@@ -1,6 +1,6 @@
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_stringptr.py b/Lib/test/test_ctypes/test_stringptr.py
similarity index 100%
rename from Lib/ctypes/test/test_stringptr.py
rename to Lib/test/test_ctypes/test_stringptr.py
diff --git a/Lib/ctypes/test/test_strings.py b/Lib/test/test_ctypes/test_strings.py
similarity index 99%
rename from Lib/ctypes/test/test_strings.py
rename to Lib/test/test_ctypes/test_strings.py
index 12e208828a..a9003be3f5 100644
--- a/Lib/ctypes/test/test_strings.py
+++ b/Lib/test/test_ctypes/test_strings.py
@@ -1,6 +1,6 @@
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 class StringArrayTestCase(unittest.TestCase):
     def test(self):
diff --git a/Lib/ctypes/test/test_struct_fields.py b/Lib/test/test_ctypes/test_struct_fields.py
similarity index 100%
rename from Lib/ctypes/test/test_struct_fields.py
rename to Lib/test/test_ctypes/test_struct_fields.py
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/test/test_ctypes/test_structures.py
similarity index 99%
rename from Lib/ctypes/test/test_structures.py
rename to Lib/test/test_ctypes/test_structures.py
index 97ad2b8ed8..13c0470ba2 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/test/test_ctypes/test_structures.py
@@ -2,7 +2,7 @@
 import sys
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes 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/test_ctypes/test_unaligned_structures.py
similarity index 100%
rename from Lib/ctypes/test/test_unaligned_structures.py
rename to Lib/test/test_ctypes/test_unaligned_structures.py
diff --git a/Lib/ctypes/test/test_unicode.py b/Lib/test/test_ctypes/test_unicode.py
similarity index 97%
rename from Lib/ctypes/test/test_unicode.py
rename to Lib/test/test_ctypes/test_unicode.py
index 60c75424b7..319cb3b1dc 100644
--- a/Lib/ctypes/test/test_unicode.py
+++ b/Lib/test/test_ctypes/test_unicode.py
@@ -1,6 +1,6 @@
 import unittest
 import ctypes
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_values.py b/Lib/test/test_ctypes/test_values.py
similarity index 100%
rename from Lib/ctypes/test/test_values.py
rename to Lib/test/test_ctypes/test_values.py
diff --git a/Lib/ctypes/test/test_varsize_struct.py b/Lib/test/test_ctypes/test_varsize_struct.py
similarity index 100%
rename from Lib/ctypes/test/test_varsize_struct.py
rename to Lib/test/test_ctypes/test_varsize_struct.py
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/test/test_ctypes/test_win32.py
similarity index 100%
rename from Lib/ctypes/test/test_win32.py
rename to Lib/test/test_ctypes/test_win32.py
diff --git a/Lib/ctypes/test/test_wintypes.py b/Lib/test/test_ctypes/test_wintypes.py
similarity index 100%
rename from Lib/ctypes/test/test_wintypes.py
rename to Lib/test/test_ctypes/test_wintypes.py
diff --git a/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst b/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst
new file mode 100644
index 0000000000..121b64b133
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst
@@ -0,0 +1,2 @@
+Move ``Lib/ctypes/test/`` to ``Lib/test/test_ctypes/``. Patch by Victor
+Stinner.
diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj
index 43c570f1da..692b083349 100644
--- a/PCbuild/lib.pyproj
+++ b/PCbuild/lib.pyproj
@@ -83,59 +83,6 @@
     <Compile Include="ctypes\macholib\dylib.py" />
     <Compile Include="ctypes\macholib\framework.py" />
     <Compile Include="ctypes\macholib\__init__.py" />
-    <Compile Include="ctypes\test\test_anon.py" />
-    <Compile Include="ctypes\test\test_arrays.py" />
-    <Compile Include="ctypes\test\test_array_in_pointer.py" />
-    <Compile Include="ctypes\test\test_as_parameter.py" />
-    <Compile Include="ctypes\test\test_bitfields.py" />
-    <Compile Include="ctypes\test\test_buffers.py" />
-    <Compile Include="ctypes\test\test_bytes.py" />
-    <Compile Include="ctypes\test\test_byteswap.py" />
-    <Compile Include="ctypes\test\test_callbacks.py" />
-    <Compile Include="ctypes\test\test_cast.py" />
-    <Compile Include="ctypes\test\test_cfuncs.py" />
-    <Compile Include="ctypes\test\test_checkretval.py" />
-    <Compile Include="ctypes\test\test_delattr.py" />
-    <Compile Include="ctypes\test\test_errno.py" />
-    <Compile Include="ctypes\test\test_find.py" />
-    <Compile Include="ctypes\test\test_frombuffer.py" />
-    <Compile Include="ctypes\test\test_funcptr.py" />
-    <Compile Include="ctypes\test\test_functions.py" />
-    <Compile Include="ctypes\test\test_incomplete.py" />
-    <Compile Include="ctypes\test\test_init.py" />
-    <Compile Include="ctypes\test\test_internals.py" />
-    <Compile Include="ctypes\test\test_keeprefs.py" />
-    <Compile Include="ctypes\test\test_libc.py" />
-    <Compile Include="ctypes\test\test_loading.py" />
-    <Compile Include="ctypes\test\test_macholib.py" />
-    <Compile Include="ctypes\test\test_memfunctions.py" />
-    <Compile Include="ctypes\test\test_numbers.py" />
-    <Compile Include="ctypes\test\test_objects.py" />
-    <Compile Include="ctypes\test\test_parameters.py" />
-    <Compile Include="ctypes\test\test_pep3118.py" />
-    <Compile Include="ctypes\test\test_pickling.py" />
-    <Compile Include="ctypes\test\test_pointers.py" />
-    <Compile Include="ctypes\test\test_prototypes.py" />
-    <Compile Include="ctypes\test\test_python_api.py" />
-    <Compile Include="ctypes\test\test_random_things.py" />
-    <Compile Include="ctypes\test\test_refcounts.py" />
-    <Compile Include="ctypes\test\test_repr.py" />
-    <Compile Include="ctypes\test\test_returnfuncptrs.py" />
-    <Compile Include="ctypes\test\test_simplesubclasses.py" />
-    <Compile Include="ctypes\test\test_sizes.py" />
-    <Compile Include="ctypes\test\test_slicing.py" />
-    <Compile Include="ctypes\test\test_stringptr.py" />
-    <Compile Include="ctypes\test\test_strings.py" />
-    <Compile Include="ctypes\test\test_structures.py" />
-    <Compile Include="ctypes\test\test_struct_fields.py" />
-    <Compile Include="ctypes\test\test_unaligned_structures.py" />
-    <Compile Include="ctypes\test\test_unicode.py" />
-    <Compile Include="ctypes\test\test_values.py" />
-    <Compile Include="ctypes\test\test_varsize_struct.py" />
-    <Compile Include="ctypes\test\test_win32.py" />
-    <Compile Include="ctypes\test\test_wintypes.py" />
-    <Compile Include="ctypes\test\__init__.py" />
-    <Compile Include="ctypes\test\__main__.py" />
     <Compile Include="ctypes\util.py" />
     <Compile Include="ctypes\wintypes.py" />
     <Compile Include="ctypes\_endian.py" />
@@ -944,7 +891,59 @@
     <Compile Include="test\test_crashers.py" />
     <Compile Include="test\test_crypt.py" />
     <Compile Include="test\test_csv.py" />
-    <Compile Include="test\test_ctypes.py" />
+    <Compile Include="test\test_ctypes\test_anon.py" />
+    <Compile Include="test\test_ctypes\test_arrays.py" />
+    <Compile Include="test\test_ctypes\test_array_in_pointer.py" />
+    <Compile Include="test\test_ctypes\test_as_parameter.py" />
+    <Compile Include="test\test_ctypes\test_bitfields.py" />
+    <Compile Include="test\test_ctypes\test_buffers.py" />
+    <Compile Include="test\test_ctypes\test_bytes.py" />
+    <Compile Include="test\test_ctypes\test_byteswap.py" />
+    <Compile Include="test\test_ctypes\test_callbacks.py" />
+    <Compile Include="test\test_ctypes\test_cast.py" />
+    <Compile Include="test\test_ctypes\test_cfuncs.py" />
+    <Compile Include="test\test_ctypes\test_checkretval.py" />
+    <Compile Include="test\test_ctypes\test_delattr.py" />
+    <Compile Include="test\test_ctypes\test_errno.py" />
+    <Compile Include="test\test_ctypes\test_find.py" />
+    <Compile Include="test\test_ctypes\test_frombuffer.py" />
+    <Compile Include="test\test_ctypes\test_funcptr.py" />
+    <Compile Include="test\test_ctypes\test_functions.py" />
+    <Compile Include="test\test_ctypes\test_incomplete.py" />
+    <Compile Include="test\test_ctypes\test_init.py" />
+    <Compile Include="test\test_ctypes\test_internals.py" />
+    <Compile Include="test\test_ctypes\test_keeprefs.py" />
+    <Compile Include="test\test_ctypes\test_libc.py" />
+    <Compile Include="test\test_ctypes\test_loading.py" />
+    <Compile Include="test\test_ctypes\test_macholib.py" />
+    <Compile Include="test\test_ctypes\test_memfunctions.py" />
+    <Compile Include="test\test_ctypes\test_numbers.py" />
+    <Compile Include="test\test_ctypes\test_objects.py" />
+    <Compile Include="test\test_ctypes\test_parameters.py" />
+    <Compile Include="test\test_ctypes\test_pep3118.py" />
+    <Compile Include="test\test_ctypes\test_pickling.py" />
+    <Compile Include="test\test_ctypes\test_pointers.py" />
+    <Compile Include="test\test_ctypes\test_prototypes.py" />
+    <Compile Include="test\test_ctypes\test_python_api.py" />
+    <Compile Include="test\test_ctypes\test_random_things.py" />
+    <Compile Include="test\test_ctypes\test_refcounts.py" />
+    <Compile Include="test\test_ctypes\test_repr.py" />
+    <Compile Include="test\test_ctypes\test_returnfuncptrs.py" />
+    <Compile Include="test\test_ctypes\test_simplesubclasses.py" />
+    <Compile Include="test\test_ctypes\test_sizes.py" />
+    <Compile Include="test\test_ctypes\test_slicing.py" />
+    <Compile Include="test\test_ctypes\test_stringptr.py" />
+    <Compile Include="test\test_ctypes\test_strings.py" />
+    <Compile Include="test\test_ctypes\test_structures.py" />
+    <Compile Include="test\test_ctypes\test_struct_fields.py" />
+    <Compile Include="test\test_ctypes\test_unaligned_structures.py" />
+    <Compile Include="test\test_ctypes\test_unicode.py" />
+    <Compile Include="test\test_ctypes\test_values.py" />
+    <Compile Include="test\test_ctypes\test_varsize_struct.py" />
+    <Compile Include="test\test_ctypes\test_win32.py" />
+    <Compile Include="test\test_ctypes\test_wintypes.py" />
+    <Compile Include="test\test_ctypes\__init__.py" />
+    <Compile Include="test\test_ctypes\__main__.py" />
     <Compile Include="test\test_curses.py" />
     <Compile Include="test\test_datetime.py" />
     <Compile Include="test\test_dbm.py" />
@@ -1725,7 +1724,6 @@
     <Folder Include="concurrent\futures" />
     <Folder Include="ctypes" />
     <Folder Include="ctypes\macholib" />
-    <Folder Include="ctypes\test" />
     <Folder Include="curses" />
     <Folder Include="dbm" />
     <Folder Include="distutils" />
@@ -1769,6 +1767,7 @@
     <Folder Include="test\subprocessdata" />
     <Folder Include="test\support" />
     <Folder Include="test\test_asyncio" />
+    <Folder Include="test\test_ctypes" />
     <Folder Include="test\test_email" />
     <Folder Include="test\test_email\data" />
     <Folder Include="test\test_import" />
diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py
index b7e83517ca..d0a0570840 100755
--- a/Tools/wasm/wasm_assets.py
+++ b/Tools/wasm/wasm_assets.py
@@ -111,7 +111,6 @@
 
 # regression test sub directories
 OMIT_SUBDIRS = (
-    "ctypes/test/",
     "tkinter/test/",
     "unittest/test/",
 )
-- 
2.29.2.windows.2


From d82e0bfe8b98a122ca443b356d81998c804b686e Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@python.org>
Date: Tue, 21 Jun 2022 10:24:33 +0200
Subject: [PATCH 5/9] 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.
---
 Lib/ctypes/test/__main__.py                   |   4 -
 Lib/test/leakers/test_ctypes.py               |   2 +-
 Lib/test/test_ctypes.py                       |  10 --
 .../test => test/test_ctypes}/__init__.py     |   0
 Lib/test/test_ctypes/__main__.py              |   4 +
 .../test => test/test_ctypes}/test_anon.py    |   0
 .../test_ctypes}/test_array_in_pointer.py     |   0
 .../test => test/test_ctypes}/test_arrays.py  |   2 +-
 .../test_ctypes}/test_as_parameter.py         |   2 +-
 .../test_ctypes}/test_bitfields.py            |   2 +-
 .../test => test/test_ctypes}/test_buffers.py |   2 +-
 .../test => test/test_ctypes}/test_bytes.py   |   0
 .../test_ctypes}/test_byteswap.py             |   0
 .../test_ctypes}/test_callbacks.py            |   2 +-
 .../test => test/test_ctypes}/test_cast.py    |   2 +-
 .../test => test/test_ctypes}/test_cfuncs.py  |   2 +-
 .../test_ctypes}/test_checkretval.py          |   2 +-
 .../test => test/test_ctypes}/test_delattr.py |   0
 .../test => test/test_ctypes}/test_errno.py   |   0
 .../test => test/test_ctypes}/test_find.py    |   0
 .../test_ctypes}/test_frombuffer.py           |   0
 .../test => test/test_ctypes}/test_funcptr.py |   0
 .../test_ctypes}/test_functions.py            |   2 +-
 .../test_ctypes}/test_incomplete.py           |   0
 .../test => test/test_ctypes}/test_init.py    |   0
 .../test_ctypes}/test_internals.py            |   0
 .../test_ctypes}/test_keeprefs.py             |   0
 .../test => test/test_ctypes}/test_libc.py    |   0
 .../test => test/test_ctypes}/test_loading.py |   0
 .../test_ctypes}/test_macholib.py             |   0
 .../test_ctypes}/test_memfunctions.py         |   2 +-
 .../test => test/test_ctypes}/test_numbers.py |   0
 .../test => test/test_ctypes}/test_objects.py |   8 +-
 .../test_ctypes}/test_parameters.py           |   2 +-
 .../test => test/test_ctypes}/test_pep3118.py |   0
 .../test_ctypes}/test_pickling.py             |   0
 .../test_ctypes}/test_pointers.py             |   0
 .../test_ctypes}/test_prototypes.py           |   2 +-
 .../test_ctypes}/test_python_api.py           |   0
 .../test_ctypes}/test_random_things.py        |   0
 .../test_ctypes}/test_refcounts.py            |   0
 .../test => test/test_ctypes}/test_repr.py    |   0
 .../test_ctypes}/test_returnfuncptrs.py       |   0
 .../test_ctypes}/test_simplesubclasses.py     |   0
 .../test => test/test_ctypes}/test_sizes.py   |   0
 .../test => test/test_ctypes}/test_slicing.py |   2 +-
 .../test_ctypes}/test_stringptr.py            |   0
 .../test => test/test_ctypes}/test_strings.py |   2 +-
 .../test_ctypes}/test_struct_fields.py        |   0
 .../test_ctypes}/test_structures.py           |   2 +-
 .../test_ctypes}/test_unaligned_structures.py |   0
 .../test => test/test_ctypes}/test_unicode.py |   2 +-
 .../test => test/test_ctypes}/test_values.py  |   0
 .../test_ctypes}/test_varsize_struct.py       |   0
 .../test => test/test_ctypes}/test_win32.py   |   0
 .../test_ctypes}/test_wintypes.py             |   0
 Makefile.pre.in                               |   4 +-
 ...2-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst |   2 +
 PCbuild/lib.pyproj                            | 109 +++++++++---------
 Tools/wasm/wasm_assets.py                     |   1 -
 60 files changed, 83 insertions(+), 93 deletions(-)
 delete mode 100644 Lib/ctypes/test/__main__.py
 delete mode 100644 Lib/test/test_ctypes.py
 rename Lib/{ctypes/test => test/test_ctypes}/__init__.py (100%)
 create mode 100644 Lib/test/test_ctypes/__main__.py
 rename Lib/{ctypes/test => test/test_ctypes}/test_anon.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_array_in_pointer.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_arrays.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_as_parameter.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_bitfields.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_buffers.py (98%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_bytes.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_byteswap.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_callbacks.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_cast.py (98%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_cfuncs.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_checkretval.py (95%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_delattr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_errno.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_find.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_frombuffer.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_funcptr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_functions.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_incomplete.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_init.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_internals.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_keeprefs.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_libc.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_loading.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_macholib.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_memfunctions.py (98%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_numbers.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_objects.py (87%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_parameters.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_pep3118.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_pickling.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_pointers.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_prototypes.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_python_api.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_random_things.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_refcounts.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_repr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_returnfuncptrs.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_simplesubclasses.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_sizes.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_slicing.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_stringptr.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_strings.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_struct_fields.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_structures.py (99%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_unaligned_structures.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_unicode.py (97%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_values.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_varsize_struct.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_win32.py (100%)
 rename Lib/{ctypes/test => test/test_ctypes}/test_wintypes.py (100%)
 create mode 100644 Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst

diff --git a/Lib/ctypes/test/__main__.py b/Lib/ctypes/test/__main__.py
deleted file mode 100644
index 362a9ec8cf..0000000000
--- 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/test/leakers/test_ctypes.py b/Lib/test/leakers/test_ctypes.py
index 7d7e9ff3a1..ec09ac3699 100644
--- a/Lib/test/leakers/test_ctypes.py
+++ b/Lib/test/leakers/test_ctypes.py
@@ -1,5 +1,5 @@
 
-# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test().
+# Taken from Lib/test/test_ctypes/test_keeprefs.py, PointerToStructure.test().
 
 from ctypes import Structure, c_int, POINTER
 import gc
diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py
deleted file mode 100644
index b0a12c9734..0000000000
--- a/Lib/test/test_ctypes.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import unittest
-from test.support.import_helper import import_module
-
-
-ctypes_test = import_module('ctypes.test')
-
-load_tests = ctypes_test.load_tests
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/Lib/ctypes/test/__init__.py b/Lib/test/test_ctypes/__init__.py
similarity index 100%
rename from Lib/ctypes/test/__init__.py
rename to Lib/test/test_ctypes/__init__.py
diff --git a/Lib/test/test_ctypes/__main__.py b/Lib/test/test_ctypes/__main__.py
new file mode 100644
index 0000000000..3003d4db89
--- /dev/null
+++ b/Lib/test/test_ctypes/__main__.py
@@ -0,0 +1,4 @@
+from test.test_ctypes import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/ctypes/test/test_anon.py b/Lib/test/test_ctypes/test_anon.py
similarity index 100%
rename from Lib/ctypes/test/test_anon.py
rename to Lib/test/test_ctypes/test_anon.py
diff --git a/Lib/ctypes/test/test_array_in_pointer.py b/Lib/test/test_ctypes/test_array_in_pointer.py
similarity index 100%
rename from Lib/ctypes/test/test_array_in_pointer.py
rename to Lib/test/test_ctypes/test_array_in_pointer.py
diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/test/test_ctypes/test_arrays.py
similarity index 99%
rename from Lib/ctypes/test/test_arrays.py
rename to Lib/test/test_ctypes/test_arrays.py
index 14603b7049..415a5785a9 100644
--- a/Lib/ctypes/test/test_arrays.py
+++ b/Lib/test/test_ctypes/test_arrays.py
@@ -3,7 +3,7 @@
 import sys
 from ctypes import *
 
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 formats = "bBhHiIlLqQfd"
 
diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py
similarity index 99%
rename from Lib/ctypes/test/test_as_parameter.py
rename to Lib/test/test_ctypes/test_as_parameter.py
index f9d27cb89d..b35defb158 100644
--- a/Lib/ctypes/test/test_as_parameter.py
+++ b/Lib/test/test_ctypes/test_as_parameter.py
@@ -1,6 +1,6 @@
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import _ctypes_test
 
 dll = CDLL(_ctypes_test.__file__)
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/test/test_ctypes/test_bitfields.py
similarity index 99%
rename from Lib/ctypes/test/test_bitfields.py
rename to Lib/test/test_ctypes/test_bitfields.py
index 66acd62e68..dad71a0ba7 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/test/test_ctypes/test_bitfields.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 from test import support
 import unittest
 import os
diff --git a/Lib/ctypes/test/test_buffers.py b/Lib/test/test_ctypes/test_buffers.py
similarity index 98%
rename from Lib/ctypes/test/test_buffers.py
rename to Lib/test/test_ctypes/test_buffers.py
index 15782be757..a9be2023aa 100644
--- a/Lib/ctypes/test/test_buffers.py
+++ b/Lib/test/test_ctypes/test_buffers.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import unittest
 
 class StringBufferTestCase(unittest.TestCase):
diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/test/test_ctypes/test_bytes.py
similarity index 100%
rename from Lib/ctypes/test/test_bytes.py
rename to Lib/test/test_ctypes/test_bytes.py
diff --git a/Lib/ctypes/test/test_byteswap.py b/Lib/test/test_ctypes/test_byteswap.py
similarity index 100%
rename from Lib/ctypes/test/test_byteswap.py
rename to Lib/test/test_ctypes/test_byteswap.py
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/test/test_ctypes/test_callbacks.py
similarity index 99%
rename from Lib/ctypes/test/test_callbacks.py
rename to Lib/test/test_ctypes/test_callbacks.py
index 1099cf9a69..2758720d4a 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/test/test_ctypes/test_callbacks.py
@@ -3,7 +3,7 @@
 from test import support
 
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 from _ctypes import CTYPES_MAX_ARGCOUNT
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_cast.py b/Lib/test/test_ctypes/test_cast.py
similarity index 98%
rename from Lib/ctypes/test/test_cast.py
rename to Lib/test/test_ctypes/test_cast.py
index 6878f97328..7ee23b16f1 100644
--- a/Lib/ctypes/test/test_cast.py
+++ b/Lib/test/test_ctypes/test_cast.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import unittest
 import sys
 
diff --git a/Lib/ctypes/test/test_cfuncs.py b/Lib/test/test_ctypes/test_cfuncs.py
similarity index 99%
rename from Lib/ctypes/test/test_cfuncs.py
rename to Lib/test/test_ctypes/test_cfuncs.py
index ac2240fa19..0a9394bf31 100644
--- a/Lib/ctypes/test/test_cfuncs.py
+++ b/Lib/test/test_ctypes/test_cfuncs.py
@@ -3,7 +3,7 @@
 
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/test/test_ctypes/test_checkretval.py
similarity index 95%
rename from Lib/ctypes/test/test_checkretval.py
rename to Lib/test/test_ctypes/test_checkretval.py
index e9567dc391..1492099f4b 100644
--- a/Lib/ctypes/test/test_checkretval.py
+++ b/Lib/test/test_ctypes/test_checkretval.py
@@ -1,7 +1,7 @@
 import unittest
 
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 class CHECKED(c_int):
     def _check_retval_(value):
diff --git a/Lib/ctypes/test/test_delattr.py b/Lib/test/test_ctypes/test_delattr.py
similarity index 100%
rename from Lib/ctypes/test/test_delattr.py
rename to Lib/test/test_ctypes/test_delattr.py
diff --git a/Lib/ctypes/test/test_errno.py b/Lib/test/test_ctypes/test_errno.py
similarity index 100%
rename from Lib/ctypes/test/test_errno.py
rename to Lib/test/test_ctypes/test_errno.py
diff --git a/Lib/ctypes/test/test_find.py b/Lib/test/test_ctypes/test_find.py
similarity index 100%
rename from Lib/ctypes/test/test_find.py
rename to Lib/test/test_ctypes/test_find.py
diff --git a/Lib/ctypes/test/test_frombuffer.py b/Lib/test/test_ctypes/test_frombuffer.py
similarity index 100%
rename from Lib/ctypes/test/test_frombuffer.py
rename to Lib/test/test_ctypes/test_frombuffer.py
diff --git a/Lib/ctypes/test/test_funcptr.py b/Lib/test/test_ctypes/test_funcptr.py
similarity index 100%
rename from Lib/ctypes/test/test_funcptr.py
rename to Lib/test/test_ctypes/test_funcptr.py
diff --git a/Lib/ctypes/test/test_functions.py b/Lib/test/test_ctypes/test_functions.py
similarity index 99%
rename from Lib/ctypes/test/test_functions.py
rename to Lib/test/test_ctypes/test_functions.py
index f9e92e1cc6..4a784c8d79 100644
--- a/Lib/ctypes/test/test_functions.py
+++ b/Lib/test/test_ctypes/test_functions.py
@@ -6,7 +6,7 @@
 """
 
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import sys, unittest
 
 try:
diff --git a/Lib/ctypes/test/test_incomplete.py b/Lib/test/test_ctypes/test_incomplete.py
similarity index 100%
rename from Lib/ctypes/test/test_incomplete.py
rename to Lib/test/test_ctypes/test_incomplete.py
diff --git a/Lib/ctypes/test/test_init.py b/Lib/test/test_ctypes/test_init.py
similarity index 100%
rename from Lib/ctypes/test/test_init.py
rename to Lib/test/test_ctypes/test_init.py
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/test/test_ctypes/test_internals.py
similarity index 100%
rename from Lib/ctypes/test/test_internals.py
rename to Lib/test/test_ctypes/test_internals.py
diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/test/test_ctypes/test_keeprefs.py
similarity index 100%
rename from Lib/ctypes/test/test_keeprefs.py
rename to Lib/test/test_ctypes/test_keeprefs.py
diff --git a/Lib/ctypes/test/test_libc.py b/Lib/test/test_ctypes/test_libc.py
similarity index 100%
rename from Lib/ctypes/test/test_libc.py
rename to Lib/test/test_ctypes/test_libc.py
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/test/test_ctypes/test_loading.py
similarity index 100%
rename from Lib/ctypes/test/test_loading.py
rename to Lib/test/test_ctypes/test_loading.py
diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/test/test_ctypes/test_macholib.py
similarity index 100%
rename from Lib/ctypes/test/test_macholib.py
rename to Lib/test/test_ctypes/test_macholib.py
diff --git a/Lib/ctypes/test/test_memfunctions.py b/Lib/test/test_ctypes/test_memfunctions.py
similarity index 98%
rename from Lib/ctypes/test/test_memfunctions.py
rename to Lib/test/test_ctypes/test_memfunctions.py
index e784b9a706..d5c9735211 100644
--- a/Lib/ctypes/test/test_memfunctions.py
+++ b/Lib/test/test_ctypes/test_memfunctions.py
@@ -2,7 +2,7 @@
 from test import support
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 class MemFunctionsTest(unittest.TestCase):
     @unittest.skip('test disabled')
diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/test/test_ctypes/test_numbers.py
similarity index 100%
rename from Lib/ctypes/test/test_numbers.py
rename to Lib/test/test_ctypes/test_numbers.py
diff --git a/Lib/ctypes/test/test_objects.py b/Lib/test/test_ctypes/test_objects.py
similarity index 87%
rename from Lib/ctypes/test/test_objects.py
rename to Lib/test/test_ctypes/test_objects.py
index 19e3dc1f2d..44a3c61ad7 100644
--- a/Lib/ctypes/test/test_objects.py
+++ b/Lib/test/test_ctypes/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
-<ctypes.test.test_objects.X object at 0x...>
+<test.test_ctypes.test_objects.X object at 0x...>
 >>>
 
 >>> x.array[0] = b'spam spam spam'
@@ -56,12 +56,12 @@
 
 import unittest, doctest
 
-import ctypes.test.test_objects
+import test.test_ctypes.test_objects
 
 class TestCase(unittest.TestCase):
     def test(self):
-        failures, tests = doctest.testmod(ctypes.test.test_objects)
+        failures, tests = doctest.testmod(test.test_ctypes.test_objects)
         self.assertFalse(failures, 'doctests failed, see output above')
 
 if __name__ == '__main__':
-    doctest.testmod(ctypes.test.test_objects)
+    doctest.testmod(test.test_ctypes.test_objects)
diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/test/test_ctypes/test_parameters.py
similarity index 99%
rename from Lib/ctypes/test/test_parameters.py
rename to Lib/test/test_ctypes/test_parameters.py
index 38af7ac13d..2f755a6d09 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/test/test_ctypes/test_parameters.py
@@ -1,5 +1,5 @@
 import unittest
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import test.support
 
 class SimpleTypesTestCase(unittest.TestCase):
diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/test/test_ctypes/test_pep3118.py
similarity index 100%
rename from Lib/ctypes/test/test_pep3118.py
rename to Lib/test/test_ctypes/test_pep3118.py
diff --git a/Lib/ctypes/test/test_pickling.py b/Lib/test/test_ctypes/test_pickling.py
similarity index 100%
rename from Lib/ctypes/test/test_pickling.py
rename to Lib/test/test_ctypes/test_pickling.py
diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/test/test_ctypes/test_pointers.py
similarity index 100%
rename from Lib/ctypes/test/test_pointers.py
rename to Lib/test/test_ctypes/test_pointers.py
diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/test/test_ctypes/test_prototypes.py
similarity index 99%
rename from Lib/ctypes/test/test_prototypes.py
rename to Lib/test/test_ctypes/test_prototypes.py
index cd0c649de3..bf27561487 100644
--- a/Lib/ctypes/test/test_prototypes.py
+++ b/Lib/test/test_ctypes/test_prototypes.py
@@ -1,5 +1,5 @@
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 import unittest
 
 # IMPORTANT INFO:
diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/test/test_ctypes/test_python_api.py
similarity index 100%
rename from Lib/ctypes/test/test_python_api.py
rename to Lib/test/test_ctypes/test_python_api.py
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/test/test_ctypes/test_random_things.py
similarity index 100%
rename from Lib/ctypes/test/test_random_things.py
rename to Lib/test/test_ctypes/test_random_things.py
diff --git a/Lib/ctypes/test/test_refcounts.py b/Lib/test/test_ctypes/test_refcounts.py
similarity index 100%
rename from Lib/ctypes/test/test_refcounts.py
rename to Lib/test/test_ctypes/test_refcounts.py
diff --git a/Lib/ctypes/test/test_repr.py b/Lib/test/test_ctypes/test_repr.py
similarity index 100%
rename from Lib/ctypes/test/test_repr.py
rename to Lib/test/test_ctypes/test_repr.py
diff --git a/Lib/ctypes/test/test_returnfuncptrs.py b/Lib/test/test_ctypes/test_returnfuncptrs.py
similarity index 100%
rename from Lib/ctypes/test/test_returnfuncptrs.py
rename to Lib/test/test_ctypes/test_returnfuncptrs.py
diff --git a/Lib/ctypes/test/test_simplesubclasses.py b/Lib/test/test_ctypes/test_simplesubclasses.py
similarity index 100%
rename from Lib/ctypes/test/test_simplesubclasses.py
rename to Lib/test/test_ctypes/test_simplesubclasses.py
diff --git a/Lib/ctypes/test/test_sizes.py b/Lib/test/test_ctypes/test_sizes.py
similarity index 100%
rename from Lib/ctypes/test/test_sizes.py
rename to Lib/test/test_ctypes/test_sizes.py
diff --git a/Lib/ctypes/test/test_slicing.py b/Lib/test/test_ctypes/test_slicing.py
similarity index 99%
rename from Lib/ctypes/test/test_slicing.py
rename to Lib/test/test_ctypes/test_slicing.py
index a3932f1767..b3e68f9a82 100644
--- a/Lib/ctypes/test/test_slicing.py
+++ b/Lib/test/test_ctypes/test_slicing.py
@@ -1,6 +1,6 @@
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_stringptr.py b/Lib/test/test_ctypes/test_stringptr.py
similarity index 100%
rename from Lib/ctypes/test/test_stringptr.py
rename to Lib/test/test_ctypes/test_stringptr.py
diff --git a/Lib/ctypes/test/test_strings.py b/Lib/test/test_ctypes/test_strings.py
similarity index 99%
rename from Lib/ctypes/test/test_strings.py
rename to Lib/test/test_ctypes/test_strings.py
index 12e208828a..a9003be3f5 100644
--- a/Lib/ctypes/test/test_strings.py
+++ b/Lib/test/test_ctypes/test_strings.py
@@ -1,6 +1,6 @@
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 class StringArrayTestCase(unittest.TestCase):
     def test(self):
diff --git a/Lib/ctypes/test/test_struct_fields.py b/Lib/test/test_ctypes/test_struct_fields.py
similarity index 100%
rename from Lib/ctypes/test/test_struct_fields.py
rename to Lib/test/test_ctypes/test_struct_fields.py
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/test/test_ctypes/test_structures.py
similarity index 99%
rename from Lib/ctypes/test/test_structures.py
rename to Lib/test/test_ctypes/test_structures.py
index 97ad2b8ed8..13c0470ba2 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/test/test_ctypes/test_structures.py
@@ -2,7 +2,7 @@
 import sys
 import unittest
 from ctypes import *
-from ctypes.test import need_symbol
+from test.test_ctypes 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/test_ctypes/test_unaligned_structures.py
similarity index 100%
rename from Lib/ctypes/test/test_unaligned_structures.py
rename to Lib/test/test_ctypes/test_unaligned_structures.py
diff --git a/Lib/ctypes/test/test_unicode.py b/Lib/test/test_ctypes/test_unicode.py
similarity index 97%
rename from Lib/ctypes/test/test_unicode.py
rename to Lib/test/test_ctypes/test_unicode.py
index 60c75424b7..319cb3b1dc 100644
--- a/Lib/ctypes/test/test_unicode.py
+++ b/Lib/test/test_ctypes/test_unicode.py
@@ -1,6 +1,6 @@
 import unittest
 import ctypes
-from ctypes.test import need_symbol
+from test.test_ctypes import need_symbol
 
 import _ctypes_test
 
diff --git a/Lib/ctypes/test/test_values.py b/Lib/test/test_ctypes/test_values.py
similarity index 100%
rename from Lib/ctypes/test/test_values.py
rename to Lib/test/test_ctypes/test_values.py
diff --git a/Lib/ctypes/test/test_varsize_struct.py b/Lib/test/test_ctypes/test_varsize_struct.py
similarity index 100%
rename from Lib/ctypes/test/test_varsize_struct.py
rename to Lib/test/test_ctypes/test_varsize_struct.py
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/test/test_ctypes/test_win32.py
similarity index 100%
rename from Lib/ctypes/test/test_win32.py
rename to Lib/test/test_ctypes/test_win32.py
diff --git a/Lib/ctypes/test/test_wintypes.py b/Lib/test/test_ctypes/test_wintypes.py
similarity index 100%
rename from Lib/ctypes/test/test_wintypes.py
rename to Lib/test/test_ctypes/test_wintypes.py
diff --git a/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst b/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst
new file mode 100644
index 0000000000..121b64b133
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst
@@ -0,0 +1,2 @@
+Move ``Lib/ctypes/test/`` to ``Lib/test/test_ctypes/``. Patch by Victor
+Stinner.
diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj
index 43c570f1da..692b083349 100644
--- a/PCbuild/lib.pyproj
+++ b/PCbuild/lib.pyproj
@@ -83,59 +83,6 @@
     <Compile Include="ctypes\macholib\dylib.py" />
     <Compile Include="ctypes\macholib\framework.py" />
     <Compile Include="ctypes\macholib\__init__.py" />
-    <Compile Include="ctypes\test\test_anon.py" />
-    <Compile Include="ctypes\test\test_arrays.py" />
-    <Compile Include="ctypes\test\test_array_in_pointer.py" />
-    <Compile Include="ctypes\test\test_as_parameter.py" />
-    <Compile Include="ctypes\test\test_bitfields.py" />
-    <Compile Include="ctypes\test\test_buffers.py" />
-    <Compile Include="ctypes\test\test_bytes.py" />
-    <Compile Include="ctypes\test\test_byteswap.py" />
-    <Compile Include="ctypes\test\test_callbacks.py" />
-    <Compile Include="ctypes\test\test_cast.py" />
-    <Compile Include="ctypes\test\test_cfuncs.py" />
-    <Compile Include="ctypes\test\test_checkretval.py" />
-    <Compile Include="ctypes\test\test_delattr.py" />
-    <Compile Include="ctypes\test\test_errno.py" />
-    <Compile Include="ctypes\test\test_find.py" />
-    <Compile Include="ctypes\test\test_frombuffer.py" />
-    <Compile Include="ctypes\test\test_funcptr.py" />
-    <Compile Include="ctypes\test\test_functions.py" />
-    <Compile Include="ctypes\test\test_incomplete.py" />
-    <Compile Include="ctypes\test\test_init.py" />
-    <Compile Include="ctypes\test\test_internals.py" />
-    <Compile Include="ctypes\test\test_keeprefs.py" />
-    <Compile Include="ctypes\test\test_libc.py" />
-    <Compile Include="ctypes\test\test_loading.py" />
-    <Compile Include="ctypes\test\test_macholib.py" />
-    <Compile Include="ctypes\test\test_memfunctions.py" />
-    <Compile Include="ctypes\test\test_numbers.py" />
-    <Compile Include="ctypes\test\test_objects.py" />
-    <Compile Include="ctypes\test\test_parameters.py" />
-    <Compile Include="ctypes\test\test_pep3118.py" />
-    <Compile Include="ctypes\test\test_pickling.py" />
-    <Compile Include="ctypes\test\test_pointers.py" />
-    <Compile Include="ctypes\test\test_prototypes.py" />
-    <Compile Include="ctypes\test\test_python_api.py" />
-    <Compile Include="ctypes\test\test_random_things.py" />
-    <Compile Include="ctypes\test\test_refcounts.py" />
-    <Compile Include="ctypes\test\test_repr.py" />
-    <Compile Include="ctypes\test\test_returnfuncptrs.py" />
-    <Compile Include="ctypes\test\test_simplesubclasses.py" />
-    <Compile Include="ctypes\test\test_sizes.py" />
-    <Compile Include="ctypes\test\test_slicing.py" />
-    <Compile Include="ctypes\test\test_stringptr.py" />
-    <Compile Include="ctypes\test\test_strings.py" />
-    <Compile Include="ctypes\test\test_structures.py" />
-    <Compile Include="ctypes\test\test_struct_fields.py" />
-    <Compile Include="ctypes\test\test_unaligned_structures.py" />
-    <Compile Include="ctypes\test\test_unicode.py" />
-    <Compile Include="ctypes\test\test_values.py" />
-    <Compile Include="ctypes\test\test_varsize_struct.py" />
-    <Compile Include="ctypes\test\test_win32.py" />
-    <Compile Include="ctypes\test\test_wintypes.py" />
-    <Compile Include="ctypes\test\__init__.py" />
-    <Compile Include="ctypes\test\__main__.py" />
     <Compile Include="ctypes\util.py" />
     <Compile Include="ctypes\wintypes.py" />
     <Compile Include="ctypes\_endian.py" />
@@ -944,7 +891,59 @@
     <Compile Include="test\test_crashers.py" />
     <Compile Include="test\test_crypt.py" />
     <Compile Include="test\test_csv.py" />
-    <Compile Include="test\test_ctypes.py" />
+    <Compile Include="test\test_ctypes\test_anon.py" />
+    <Compile Include="test\test_ctypes\test_arrays.py" />
+    <Compile Include="test\test_ctypes\test_array_in_pointer.py" />
+    <Compile Include="test\test_ctypes\test_as_parameter.py" />
+    <Compile Include="test\test_ctypes\test_bitfields.py" />
+    <Compile Include="test\test_ctypes\test_buffers.py" />
+    <Compile Include="test\test_ctypes\test_bytes.py" />
+    <Compile Include="test\test_ctypes\test_byteswap.py" />
+    <Compile Include="test\test_ctypes\test_callbacks.py" />
+    <Compile Include="test\test_ctypes\test_cast.py" />
+    <Compile Include="test\test_ctypes\test_cfuncs.py" />
+    <Compile Include="test\test_ctypes\test_checkretval.py" />
+    <Compile Include="test\test_ctypes\test_delattr.py" />
+    <Compile Include="test\test_ctypes\test_errno.py" />
+    <Compile Include="test\test_ctypes\test_find.py" />
+    <Compile Include="test\test_ctypes\test_frombuffer.py" />
+    <Compile Include="test\test_ctypes\test_funcptr.py" />
+    <Compile Include="test\test_ctypes\test_functions.py" />
+    <Compile Include="test\test_ctypes\test_incomplete.py" />
+    <Compile Include="test\test_ctypes\test_init.py" />
+    <Compile Include="test\test_ctypes\test_internals.py" />
+    <Compile Include="test\test_ctypes\test_keeprefs.py" />
+    <Compile Include="test\test_ctypes\test_libc.py" />
+    <Compile Include="test\test_ctypes\test_loading.py" />
+    <Compile Include="test\test_ctypes\test_macholib.py" />
+    <Compile Include="test\test_ctypes\test_memfunctions.py" />
+    <Compile Include="test\test_ctypes\test_numbers.py" />
+    <Compile Include="test\test_ctypes\test_objects.py" />
+    <Compile Include="test\test_ctypes\test_parameters.py" />
+    <Compile Include="test\test_ctypes\test_pep3118.py" />
+    <Compile Include="test\test_ctypes\test_pickling.py" />
+    <Compile Include="test\test_ctypes\test_pointers.py" />
+    <Compile Include="test\test_ctypes\test_prototypes.py" />
+    <Compile Include="test\test_ctypes\test_python_api.py" />
+    <Compile Include="test\test_ctypes\test_random_things.py" />
+    <Compile Include="test\test_ctypes\test_refcounts.py" />
+    <Compile Include="test\test_ctypes\test_repr.py" />
+    <Compile Include="test\test_ctypes\test_returnfuncptrs.py" />
+    <Compile Include="test\test_ctypes\test_simplesubclasses.py" />
+    <Compile Include="test\test_ctypes\test_sizes.py" />
+    <Compile Include="test\test_ctypes\test_slicing.py" />
+    <Compile Include="test\test_ctypes\test_stringptr.py" />
+    <Compile Include="test\test_ctypes\test_strings.py" />
+    <Compile Include="test\test_ctypes\test_structures.py" />
+    <Compile Include="test\test_ctypes\test_struct_fields.py" />
+    <Compile Include="test\test_ctypes\test_unaligned_structures.py" />
+    <Compile Include="test\test_ctypes\test_unicode.py" />
+    <Compile Include="test\test_ctypes\test_values.py" />
+    <Compile Include="test\test_ctypes\test_varsize_struct.py" />
+    <Compile Include="test\test_ctypes\test_win32.py" />
+    <Compile Include="test\test_ctypes\test_wintypes.py" />
+    <Compile Include="test\test_ctypes\__init__.py" />
+    <Compile Include="test\test_ctypes\__main__.py" />
     <Compile Include="test\test_curses.py" />
     <Compile Include="test\test_datetime.py" />
     <Compile Include="test\test_dbm.py" />
@@ -1725,7 +1724,6 @@
     <Folder Include="concurrent\futures" />
     <Folder Include="ctypes" />
     <Folder Include="ctypes\macholib" />
-    <Folder Include="ctypes\test" />
     <Folder Include="curses" />
     <Folder Include="dbm" />
     <Folder Include="distutils" />
@@ -1769,6 +1767,7 @@
     <Folder Include="test\subprocessdata" />
     <Folder Include="test\support" />
     <Folder Include="test\test_asyncio" />
+    <Folder Include="test\test_ctypes" />
     <Folder Include="test\test_email" />
     <Folder Include="test\test_email\data" />
     <Folder Include="test\test_import" />
diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py
index b7e83517ca..d0a0570840 100755
--- a/Tools/wasm/wasm_assets.py
+++ b/Tools/wasm/wasm_assets.py
@@ -111,7 +111,6 @@
 
 # regression test sub directories
 OMIT_SUBDIRS = (
-    "ctypes/test/",
     "tkinter/test/",
     "unittest/test/",
 )
-- 
2.29.2.windows.2

