Repository: pyodide/pyodide

Issue:
Python 3.12 version
## 🚀 Feature

<!-- A clear and concise description of the feature proposal -->

Hi, I tried [REPL](https://pyodide.org/en/stable/console.html), maybe it uses the latest 0.25.0, and I noticed that the python is 3.11.3.

Python 3.12 has released for a few months with a lot of new features. Since there is no issue track the progress. So, I created this one.

### Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->

N.A.

### Pitch

<!-- A clear and concise description of what you want to happen. -->

N.A.

### Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->

N.A.

### Additional context

<!-- Add any other context or screenshots about the feature request here. -->

N.A.


Discussion:
Generally we aim to wait about six months after a new Python release comes out before updating, so since the Python versions are released in August, we usually do the update in February / March. This reduces the number of broken packages that we have to deal with in the update. Anyways it's about time to start working on this.
@hoodmane Thanks, I see. 😃 

Resolving patch:
diff --git a/pyodide-build/pyodide_build/pyzip.py b/pyodide-build/pyodide_build/pyzip.py
--- a/pyodide-build/pyodide_build/pyzip.py
+++ b/pyodide-build/pyodide_build/pyzip.py
@@ -28,7 +28,6 @@
 # These files are unvendored from the stdlib and can be loaded with `loadPackage`
 UNVENDORED_FILES = (
     "test/",
-    "distutils/",
     "sqlite3",
     "ssl.py",
     "lzma.py",


Test patch:
diff --git a/packages/distutils/test_distutils.py b/packages/distutils/test_distutils.py
deleted file mode 100644
--- a/packages/distutils/test_distutils.py
+++ /dev/null
@@ -1,34 +0,0 @@
-from pytest_pyodide import run_in_pyodide
-
-
-@run_in_pyodide(packages=["test", "distutils"], pytest_assert_rewrites=False)
-def test_distutils(selenium):
-    import sys
-    import unittest
-    import unittest.mock
-    from test.libregrtest.main import main
-
-    name = "test_distutils"
-
-    ignore_tests = [
-        "test_check_environ_getpwuid",  # no pwd
-        "test_get_platform",  # no _osx_support
-        "test_simple_built",
-        "test_optional_extension",  # thread
-        "test_customize_compiler_before_get_config_vars",  # subprocess
-        "test_spawn",  # subprocess
-        "test_debug_mode",  # no _osx_support
-        "test_record",  # no _osx_support
-        "test_get_config_h_filename",  # /include/python3.10/pyconfig.h not exists
-        "test_srcdir",  # /lib/python3.10/config-3.10-wasm32-emscripten not exists
-        "test_mkpath_with_custom_mode",
-        "test_finalize_options",  # no executable
-    ]
-    match_tests = [[pat, False] for pat in ignore_tests]
-
-    sys.modules["_osx_support"] = unittest.mock.Mock()
-    try:
-        main([name], match_tests=match_tests, verbose=True, verbose3=True)
-    except SystemExit as e:
-        if e.code != 0:
-            raise RuntimeError(f"Failed with code: {e.code}") from None
diff --git a/packages/test/meta.yaml b/packages/test/meta.yaml
--- a/packages/test/meta.yaml
+++ b/packages/test/meta.yaml
@@ -14,13 +14,49 @@ build:
     cat $(PYODIDE_ROOT)/cpython/patches/* | patch -p1
     export TEST_EXTENSIONS="\
       _testinternalcapi.so \
-      _testcapi.so \
       _testbuffer.so \
       _testimportmultiple.so \
       _testmultiphase.so \
       _ctypes_test.so \
     "
 
+    export TEST_CAPI_SRCS=( \
+      _testcapimodule.c \
+      _testcapi/vectorcall.c \
+      _testcapi/vectorcall_limited.c \
+      _testcapi/heaptype.c \
+      _testcapi/abstract.c \
+      _testcapi/bytearray.c \
+      _testcapi/bytes.c \
+      _testcapi/unicode.c \
+      _testcapi/dict.c \
+      _testcapi/set.c \
+      _testcapi/list.c \
+      _testcapi/tuple.c \
+      _testcapi/getargs.c \
+      _testcapi/pytime.c \
+      _testcapi/datetime.c \
+      _testcapi/docstring.c \
+      _testcapi/mem.c \
+      _testcapi/watchers.c \
+      _testcapi/long.c \
+      _testcapi/float.c \
+      _testcapi/complex.c \
+      _testcapi/numbers.c \
+      _testcapi/structmember.c \
+      _testcapi/exceptions.c \
+      _testcapi/code.c \
+      _testcapi/buffer.c \
+      _testcapi/pyos.c \
+      _testcapi/file.c \
+      _testcapi/codec.c \
+      _testcapi/immortal.c \
+      _testcapi/heaptype_relative.c \
+      _testcapi/gc.c \
+      _testcapi/sys.c \
+    )
+
+
     export TEST_MODULE_CFLAGS="${SIDE_MODULE_CFLAGS} -I Include/ -I Include/internal/ -I ."
 
     emcc ${TEST_MODULE_CFLAGS} -c Modules/_testinternalcapi.c -o Modules/_testinternalcapi.o \
@@ -31,11 +67,18 @@ build:
     emcc ${TEST_MODULE_CFLAGS} -c Modules/_testmultiphase.c -o Modules/_testmultiphase.o
     emcc ${TEST_MODULE_CFLAGS} -c Modules/_ctypes/_ctypes_test.c -o Modules/_ctypes_test.o
 
+    for capi_src in ${TEST_CAPI_SRCS[@]}; do \
+      emcc ${TEST_MODULE_CFLAGS} -c Modules/${capi_src} -o Modules/${capi_src/.c/.o}
+    done
+
+    export TEST_CAPI_OBJECTS=( "${TEST_CAPI_SRCS[@]/#/Modules/}" )
+    emcc  ${SIDE_MODULE_LDFLAGS} ${TEST_CAPI_OBJECTS[@]//.c/.o} -o ${DISTDIR}/_testcapi.so
+
     for testname in ${TEST_EXTENSIONS}; do \
       emcc Modules/${testname/.so/.o} -o ${DISTDIR}/$testname ${SIDE_MODULE_LDFLAGS}
     done
 
     cd Lib && \
       tar --exclude=__pycache__ -cf - \
-      test distutils/tests sqlite3/test \
+      test test/test_sqlite3/ \
       | tar -C $DISTDIR -xf -
diff --git a/packages/test/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch b/packages/test/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch
deleted file mode 100644
--- a/packages/test/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch
+++ /dev/null
@@ -1,753 +0,0 @@
-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
-
diff --git a/packages/test/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch b/packages/test/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch
deleted file mode 100644
--- a/packages/test/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch
+++ /dev/null
@@ -1,724 +0,0 @@
-From c735d545343c3ab002c62596b2fb2cfa4488b0af Mon Sep 17 00:00:00 2001
-From: Victor Stinner <vstinner@python.org>
-Date: Tue, 21 Jun 2022 10:27:59 +0200
-Subject: [PATCH 6/9] gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/
- (#94043)
-
-* Move Lib/unittest/test/ to Lib/test/test_unittest/
-* Remove Lib/test/test_unittest.py
-* Replace unittest.test with test.test_unittest
-* Remove unittest.load_tests()
-* Rewrite unittest __init__.py and __main__.py
-* Update build system, CODEOWNERS, and wasm_assets.py
----
- .github/CODEOWNERS                            |  2 +-
- Lib/test/test_unittest.py                     | 16 -----
- Lib/test/test_unittest/__init__.py            |  6 ++
- Lib/test/test_unittest/__main__.py            |  4 ++
- .../test_unittest}/_test_warnings.py          |  0
- .../test => test/test_unittest}/dummy.py      |  0
- .../test => test/test_unittest}/support.py    |  0
- .../test_unittest}/test_assertions.py         |  0
- .../test_unittest}/test_async_case.py         |  0
- .../test => test/test_unittest}/test_break.py |  0
- .../test => test/test_unittest}/test_case.py  |  2 +-
- .../test_unittest}/test_discovery.py          |  6 +-
- .../test_unittest}/test_functiontestcase.py   |  2 +-
- .../test_unittest}/test_loader.py             |  6 +-
- .../test_unittest}/test_program.py            | 16 ++---
- .../test_unittest}/test_result.py             |  0
- .../test_unittest}/test_runner.py             |  2 +-
- .../test_unittest}/test_setups.py             |  0
- .../test_unittest}/test_skipping.py           |  2 +-
- .../test => test/test_unittest}/test_suite.py |  2 +-
- .../test_unittest}/testmock/__init__.py       |  2 +-
- .../test_unittest}/testmock/__main__.py       |  2 +-
- .../test_unittest}/testmock/support.py        |  0
- .../test_unittest}/testmock/testasync.py      |  0
- .../test_unittest}/testmock/testcallable.py   |  2 +-
- .../test_unittest}/testmock/testhelpers.py    |  0
- .../testmock/testmagicmethods.py              |  0
- .../test_unittest}/testmock/testmock.py       |  2 +-
- .../test_unittest}/testmock/testpatch.py      | 22 +++----
- .../test_unittest}/testmock/testsealable.py   |  0
- .../test_unittest}/testmock/testsentinel.py   |  0
- .../test_unittest}/testmock/testwith.py       |  2 +-
- Lib/unittest/__init__.py                      | 10 ----
- Lib/unittest/test/__init__.py                 | 25 --------
- Lib/unittest/test/__main__.py                 | 18 ------
- Makefile.pre.in                               |  4 +-
- PCbuild/lib.pyproj                            | 58 +++++++++----------
- Tools/wasm/wasm_assets.py                     |  1 -
- 38 files changed, 77 insertions(+), 137 deletions(-)
- delete mode 100644 Lib/test/test_unittest.py
- create mode 100644 Lib/test/test_unittest/__init__.py
- create mode 100644 Lib/test/test_unittest/__main__.py
- rename Lib/{unittest/test => test/test_unittest}/_test_warnings.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/dummy.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/support.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/test_assertions.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/test_async_case.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/test_break.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/test_case.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/test_discovery.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/test_functiontestcase.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/test_loader.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/test_program.py (96%)
- rename Lib/{unittest/test => test/test_unittest}/test_result.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/test_runner.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/test_setups.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/test_skipping.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/test_suite.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/__init__.py (86%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/__main__.py (86%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/support.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testasync.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testcallable.py (98%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testhelpers.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testmagicmethods.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testmock.py (99%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testpatch.py (98%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testsealable.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testsentinel.py (100%)
- rename Lib/{unittest/test => test/test_unittest}/testmock/testwith.py (99%)
- delete mode 100644 Lib/unittest/test/__init__.py
- delete mode 100644 Lib/unittest/test/__main__.py
-
-diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
-deleted file mode 100644
-index 1079c7df2e..0000000000
---- a/Lib/test/test_unittest.py
-+++ /dev/null
-@@ -1,16 +0,0 @@
--import unittest.test
--
--from test import support
--
--
--def load_tests(*_):
--    # used by unittest
--    return unittest.test.suite()
--
--
--def tearDownModule():
--    support.reap_children()
--
--
--if __name__ == "__main__":
--    unittest.main()
-diff --git a/Lib/test/test_unittest/__init__.py b/Lib/test/test_unittest/__init__.py
-new file mode 100644
-index 0000000000..bc502ef32d
---- /dev/null
-+++ b/Lib/test/test_unittest/__init__.py
-@@ -0,0 +1,6 @@
-+import os.path
-+from test.support import load_package_tests
-+
-+
-+def load_tests(*args):
-+    return load_package_tests(os.path.dirname(__file__), *args)
-diff --git a/Lib/test/test_unittest/__main__.py b/Lib/test/test_unittest/__main__.py
-new file mode 100644
-index 0000000000..40a23a297e
---- /dev/null
-+++ b/Lib/test/test_unittest/__main__.py
-@@ -0,0 +1,4 @@
-+from . import load_tests
-+import unittest
-+
-+unittest.main()
-diff --git a/Lib/unittest/test/_test_warnings.py b/Lib/test/test_unittest/_test_warnings.py
-similarity index 100%
-rename from Lib/unittest/test/_test_warnings.py
-rename to Lib/test/test_unittest/_test_warnings.py
-diff --git a/Lib/unittest/test/dummy.py b/Lib/test/test_unittest/dummy.py
-similarity index 100%
-rename from Lib/unittest/test/dummy.py
-rename to Lib/test/test_unittest/dummy.py
-diff --git a/Lib/unittest/test/support.py b/Lib/test/test_unittest/support.py
-similarity index 100%
-rename from Lib/unittest/test/support.py
-rename to Lib/test/test_unittest/support.py
-diff --git a/Lib/unittest/test/test_assertions.py b/Lib/test/test_unittest/test_assertions.py
-similarity index 100%
-rename from Lib/unittest/test/test_assertions.py
-rename to Lib/test/test_unittest/test_assertions.py
-diff --git a/Lib/unittest/test/test_async_case.py b/Lib/test/test_unittest/test_async_case.py
-similarity index 100%
-rename from Lib/unittest/test/test_async_case.py
-rename to Lib/test/test_unittest/test_async_case.py
-diff --git a/Lib/unittest/test/test_break.py b/Lib/test/test_unittest/test_break.py
-similarity index 100%
-rename from Lib/unittest/test/test_break.py
-rename to Lib/test/test_unittest/test_break.py
-diff --git a/Lib/unittest/test/test_case.py b/Lib/test/test_unittest/test_case.py
-similarity index 99%
-rename from Lib/unittest/test/test_case.py
-rename to Lib/test/test_unittest/test_case.py
-index 374a255255..e000fe4f07 100644
---- a/Lib/unittest/test/test_case.py
-+++ b/Lib/test/test_unittest/test_case.py
-@@ -15,7 +15,7 @@
- 
- import unittest
- 
--from unittest.test.support import (
-+from test.test_unittest.support import (
-     TestEquality, TestHashing, LoggingResult, LegacyLoggingResult,
-     ResultWithNoStartTestRunStopTestRun
- )
-diff --git a/Lib/unittest/test/test_discovery.py b/Lib/test/test_unittest/test_discovery.py
-similarity index 99%
-rename from Lib/unittest/test/test_discovery.py
-rename to Lib/test/test_unittest/test_discovery.py
-index 3b58786ec1..946fa1258e 100644
---- a/Lib/unittest/test/test_discovery.py
-+++ b/Lib/test/test_unittest/test_discovery.py
-@@ -10,7 +10,7 @@
- 
- import unittest
- import unittest.mock
--import unittest.test
-+import test.test_unittest
- 
- 
- class TestableTestProgram(unittest.TestProgram):
-@@ -789,7 +789,7 @@ def test_discovery_from_dotted_path(self):
-         loader = unittest.TestLoader()
- 
-         tests = [self]
--        expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
-+        expectedPath = os.path.abspath(os.path.dirname(test.test_unittest.__file__))
- 
-         self.wasRun = False
-         def _find_tests(start_dir, pattern):
-@@ -797,7 +797,7 @@ def _find_tests(start_dir, pattern):
-             self.assertEqual(start_dir, expectedPath)
-             return tests
-         loader._find_tests = _find_tests
--        suite = loader.discover('unittest.test')
-+        suite = loader.discover('test.test_unittest')
-         self.assertTrue(self.wasRun)
-         self.assertEqual(suite._tests, tests)
- 
-diff --git a/Lib/unittest/test/test_functiontestcase.py b/Lib/test/test_unittest/test_functiontestcase.py
-similarity index 99%
-rename from Lib/unittest/test/test_functiontestcase.py
-rename to Lib/test/test_unittest/test_functiontestcase.py
-index 4971729880..2ebed9564a 100644
---- a/Lib/unittest/test/test_functiontestcase.py
-+++ b/Lib/test/test_unittest/test_functiontestcase.py
-@@ -1,6 +1,6 @@
- import unittest
- 
--from unittest.test.support import LoggingResult
-+from test.test_unittest.support import LoggingResult
- 
- 
- class Test_FunctionTestCase(unittest.TestCase):
-diff --git a/Lib/unittest/test/test_loader.py b/Lib/test/test_unittest/test_loader.py
-similarity index 99%
-rename from Lib/unittest/test/test_loader.py
-rename to Lib/test/test_unittest/test_loader.py
-index de2268cda9..c06ebb658d 100644
---- a/Lib/unittest/test/test_loader.py
-+++ b/Lib/test/test_unittest/test_loader.py
-@@ -716,7 +716,7 @@ def test_loadTestsFromName__module_not_loaded(self):
-         # We're going to try to load this module as a side-effect, so it
-         # better not be loaded before we try.
-         #
--        module_name = 'unittest.test.dummy'
-+        module_name = 'test.test_unittest.dummy'
-         sys.modules.pop(module_name, None)
- 
-         loader = unittest.TestLoader()
-@@ -844,7 +844,7 @@ def test_loadTestsFromNames__unknown_attr_name(self):
-         loader = unittest.TestLoader()
- 
-         suite = loader.loadTestsFromNames(
--            ['unittest.loader.sdasfasfasdf', 'unittest.test.dummy'])
-+            ['unittest.loader.sdasfasfasdf', 'test.test_unittest.dummy'])
-         error, test = self.check_deferred_error(loader, list(suite)[0])
-         expected = "module 'unittest.loader' has no attribute 'sdasfasfasdf'"
-         self.assertIn(
-@@ -1141,7 +1141,7 @@ def test_loadTestsFromNames__module_not_loaded(self):
-         # We're going to try to load this module as a side-effect, so it
-         # better not be loaded before we try.
-         #
--        module_name = 'unittest.test.dummy'
-+        module_name = 'test.test_unittest.dummy'
-         sys.modules.pop(module_name, None)
- 
-         loader = unittest.TestLoader()
-diff --git a/Lib/unittest/test/test_program.py b/Lib/test/test_unittest/test_program.py
-similarity index 96%
-rename from Lib/unittest/test/test_program.py
-rename to Lib/test/test_unittest/test_program.py
-index 26a8550af8..169fc4ed94 100644
---- a/Lib/unittest/test/test_program.py
-+++ b/Lib/test/test_unittest/test_program.py
-@@ -5,8 +5,8 @@
- import subprocess
- from test import support
- import unittest
--import unittest.test
--from unittest.test.test_result import BufferedWriter
-+import test.test_unittest
-+from test.test_unittest.test_result import BufferedWriter
- 
- 
- class Test_TestProgram(unittest.TestCase):
-@@ -15,7 +15,7 @@ def test_discovery_from_dotted_path(self):
-         loader = unittest.TestLoader()
- 
-         tests = [self]
--        expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
-+        expectedPath = os.path.abspath(os.path.dirname(test.test_unittest.__file__))
- 
-         self.wasRun = False
-         def _find_tests(start_dir, pattern):
-@@ -23,7 +23,7 @@ def _find_tests(start_dir, pattern):
-             self.assertEqual(start_dir, expectedPath)
-             return tests
-         loader._find_tests = _find_tests
--        suite = loader.discover('unittest.test')
-+        suite = loader.discover('test.test_unittest')
-         self.assertTrue(self.wasRun)
-         self.assertEqual(suite._tests, tests)
- 
-@@ -93,10 +93,10 @@ def run(self, test):
-         sys.argv = ['faketest']
-         runner = FakeRunner()
-         program = unittest.TestProgram(testRunner=runner, exit=False,
--                                       defaultTest='unittest.test',
-+                                       defaultTest='test.test_unittest',
-                                        testLoader=self.FooBarLoader())
-         sys.argv = old_argv
--        self.assertEqual(('unittest.test',), program.testNames)
-+        self.assertEqual(('test.test_unittest',), program.testNames)
- 
-     def test_defaultTest_with_iterable(self):
-         class FakeRunner(object):
-@@ -109,10 +109,10 @@ def run(self, test):
-         runner = FakeRunner()
-         program = unittest.TestProgram(
-             testRunner=runner, exit=False,
--            defaultTest=['unittest.test', 'unittest.test2'],
-+            defaultTest=['test.test_unittest', 'test.test_unittest2'],
-             testLoader=self.FooBarLoader())
-         sys.argv = old_argv
--        self.assertEqual(['unittest.test', 'unittest.test2'],
-+        self.assertEqual(['test.test_unittest', 'test.test_unittest2'],
-                           program.testNames)
- 
-     def test_NonExit(self):
-diff --git a/Lib/unittest/test/test_result.py b/Lib/test/test_unittest/test_result.py
-similarity index 100%
-rename from Lib/unittest/test/test_result.py
-rename to Lib/test/test_unittest/test_result.py
-diff --git a/Lib/unittest/test/test_runner.py b/Lib/test/test_unittest/test_runner.py
-similarity index 99%
-rename from Lib/unittest/test/test_runner.py
-rename to Lib/test/test_unittest/test_runner.py
-index d3488b40e8..9e3a0a9ca0 100644
---- a/Lib/unittest/test/test_runner.py
-+++ b/Lib/test/test_unittest/test_runner.py
-@@ -8,7 +8,7 @@
- import unittest
- from unittest.case import _Outcome
- 
--from unittest.test.support import (LoggingResult,
-+from test.test_unittest.support import (LoggingResult,
-                                    ResultWithNoStartTestRunStopTestRun)
- 
- 
-diff --git a/Lib/unittest/test/test_setups.py b/Lib/test/test_unittest/test_setups.py
-similarity index 100%
-rename from Lib/unittest/test/test_setups.py
-rename to Lib/test/test_unittest/test_setups.py
-diff --git a/Lib/unittest/test/test_skipping.py b/Lib/test/test_unittest/test_skipping.py
-similarity index 99%
-rename from Lib/unittest/test/test_skipping.py
-rename to Lib/test/test_unittest/test_skipping.py
-index 64ceeae37e..f146dcac18 100644
---- a/Lib/unittest/test/test_skipping.py
-+++ b/Lib/test/test_unittest/test_skipping.py
-@@ -1,6 +1,6 @@
- import unittest
- 
--from unittest.test.support import LoggingResult
-+from test.test_unittest.support import LoggingResult
- 
- 
- class Test_TestSkipping(unittest.TestCase):
-diff --git a/Lib/unittest/test/test_suite.py b/Lib/test/test_unittest/test_suite.py
-similarity index 99%
-rename from Lib/unittest/test/test_suite.py
-rename to Lib/test/test_unittest/test_suite.py
-index 0551a16996..ca52ee9d9c 100644
---- a/Lib/unittest/test/test_suite.py
-+++ b/Lib/test/test_unittest/test_suite.py
-@@ -3,7 +3,7 @@
- import gc
- import sys
- import weakref
--from unittest.test.support import LoggingResult, TestEquality
-+from test.test_unittest.support import LoggingResult, TestEquality
- 
- 
- ### Support code for Test_TestSuite
-diff --git a/Lib/unittest/test/testmock/__init__.py b/Lib/test/test_unittest/testmock/__init__.py
-similarity index 86%
-rename from Lib/unittest/test/testmock/__init__.py
-rename to Lib/test/test_unittest/testmock/__init__.py
-index 87d7ae994d..6ee60b2376 100644
---- a/Lib/unittest/test/testmock/__init__.py
-+++ b/Lib/test/test_unittest/testmock/__init__.py
-@@ -10,7 +10,7 @@ def load_tests(*args):
-     suite = unittest.TestSuite()
-     for fn in os.listdir(here):
-         if fn.startswith("test") and fn.endswith(".py"):
--            modname = "unittest.test.testmock." + fn[:-3]
-+            modname = "test.test_unittest.testmock." + fn[:-3]
-             __import__(modname)
-             module = sys.modules[modname]
-             suite.addTest(loader.loadTestsFromModule(module))
-diff --git a/Lib/unittest/test/testmock/__main__.py b/Lib/test/test_unittest/testmock/__main__.py
-similarity index 86%
-rename from Lib/unittest/test/testmock/__main__.py
-rename to Lib/test/test_unittest/testmock/__main__.py
-index 45c633a4ee..1e3068b0dd 100644
---- a/Lib/unittest/test/testmock/__main__.py
-+++ b/Lib/test/test_unittest/testmock/__main__.py
-@@ -6,7 +6,7 @@ def load_tests(loader, standard_tests, pattern):
-     # top level directory cached on loader instance
-     this_dir = os.path.dirname(__file__)
-     pattern = pattern or "test*.py"
--    # We are inside unittest.test.testmock, so the top-level is three notches up
-+    # We are inside test.test_unittest.testmock, so the top-level is three notches up
-     top_level_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir)))
-     package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
-                                     top_level_dir=top_level_dir)
-diff --git a/Lib/unittest/test/testmock/support.py b/Lib/test/test_unittest/testmock/support.py
-similarity index 100%
-rename from Lib/unittest/test/testmock/support.py
-rename to Lib/test/test_unittest/testmock/support.py
-diff --git a/Lib/unittest/test/testmock/testasync.py b/Lib/test/test_unittest/testmock/testasync.py
-similarity index 100%
-rename from Lib/unittest/test/testmock/testasync.py
-rename to Lib/test/test_unittest/testmock/testasync.py
-diff --git a/Lib/unittest/test/testmock/testcallable.py b/Lib/test/test_unittest/testmock/testcallable.py
-similarity index 98%
-rename from Lib/unittest/test/testmock/testcallable.py
-rename to Lib/test/test_unittest/testmock/testcallable.py
-index 5eadc00704..ca88511f63 100644
---- a/Lib/unittest/test/testmock/testcallable.py
-+++ b/Lib/test/test_unittest/testmock/testcallable.py
-@@ -3,7 +3,7 @@
- # http://www.voidspace.org.uk/python/mock/
- 
- import unittest
--from unittest.test.testmock.support import is_instance, X, SomeClass
-+from test.test_unittest.testmock.support import is_instance, X, SomeClass
- 
- from unittest.mock import (
-     Mock, MagicMock, NonCallableMagicMock,
-diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/test/test_unittest/testmock/testhelpers.py
-similarity index 100%
-rename from Lib/unittest/test/testmock/testhelpers.py
-rename to Lib/test/test_unittest/testmock/testhelpers.py
-diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/test/test_unittest/testmock/testmagicmethods.py
-similarity index 100%
-rename from Lib/unittest/test/testmock/testmagicmethods.py
-rename to Lib/test/test_unittest/testmock/testmagicmethods.py
-diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/test/test_unittest/testmock/testmock.py
-similarity index 99%
-rename from Lib/unittest/test/testmock/testmock.py
-rename to Lib/test/test_unittest/testmock/testmock.py
-index c99098dc4e..8a92490137 100644
---- a/Lib/unittest/test/testmock/testmock.py
-+++ b/Lib/test/test_unittest/testmock/testmock.py
-@@ -5,7 +5,7 @@
- 
- from test.support import ALWAYS_EQ
- import unittest
--from unittest.test.testmock.support import is_instance
-+from test.test_unittest.testmock.support import is_instance
- from unittest import mock
- from unittest.mock import (
-     call, DEFAULT, patch, sentinel,
-diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/test/test_unittest/testmock/testpatch.py
-similarity index 98%
-rename from Lib/unittest/test/testmock/testpatch.py
-rename to Lib/test/test_unittest/testmock/testpatch.py
-index 8ab63a1317..93ec0ca4be 100644
---- a/Lib/unittest/test/testmock/testpatch.py
-+++ b/Lib/test/test_unittest/testmock/testpatch.py
-@@ -7,8 +7,8 @@
- from collections import OrderedDict
- 
- import unittest
--from unittest.test.testmock import support
--from unittest.test.testmock.support import SomeClass, is_instance
-+from test.test_unittest.testmock import support
-+from test.test_unittest.testmock.support import SomeClass, is_instance
- 
- from test.test_importlib.util import uncache
- from unittest.mock import (
-@@ -669,7 +669,7 @@ def test_patch_dict_decorator_resolution(self):
-         # the new dictionary during function call
-         original = support.target.copy()
- 
--        @patch.dict('unittest.test.testmock.support.target', {'bar': 'BAR'})
-+        @patch.dict('test.test_unittest.testmock.support.target', {'bar': 'BAR'})
-         def test():
-             self.assertEqual(support.target, {'foo': 'BAZ', 'bar': 'BAR'})
- 
-@@ -1614,7 +1614,7 @@ def test_patch_with_spec_mock_repr(self):
- 
- 
-     def test_patch_nested_autospec_repr(self):
--        with patch('unittest.test.testmock.support', autospec=True) as m:
-+        with patch('test.test_unittest.testmock.support', autospec=True) as m:
-             self.assertIn(" name='support.SomeClass.wibble()'",
-                           repr(m.SomeClass.wibble()))
-             self.assertIn(" name='support.SomeClass().wibble()'",
-@@ -1882,7 +1882,7 @@ def foo(x=0):
- 
-         with patch.object(foo, '__module__', "testpatch2"):
-             self.assertEqual(foo.__module__, "testpatch2")
--        self.assertEqual(foo.__module__, 'unittest.test.testmock.testpatch')
-+        self.assertEqual(foo.__module__, 'test.test_unittest.testmock.testpatch')
- 
-         with patch.object(foo, '__annotations__', dict([('s', 1, )])):
-             self.assertEqual(foo.__annotations__, dict([('s', 1, )]))
-@@ -1917,16 +1917,16 @@ def test_dotted_but_module_not_loaded(self):
-         # This exercises the AttributeError branch of _dot_lookup.
- 
-         # make sure it's there
--        import unittest.test.testmock.support
-+        import test.test_unittest.testmock.support
-         # now make sure it's not:
-         with patch.dict('sys.modules'):
--            del sys.modules['unittest.test.testmock.support']
--            del sys.modules['unittest.test.testmock']
--            del sys.modules['unittest.test']
-+            del sys.modules['test.test_unittest.testmock.support']
-+            del sys.modules['test.test_unittest.testmock']
-+            del sys.modules['test.test_unittest']
-             del sys.modules['unittest']
- 
-             # now make sure we can patch based on a dotted path:
--            @patch('unittest.test.testmock.support.X')
-+            @patch('test.test_unittest.testmock.support.X')
-             def test(mock):
-                 pass
-             test()
-@@ -1943,7 +1943,7 @@ class Foo:
- 
- 
-     def test_cant_set_kwargs_when_passing_a_mock(self):
--        @patch('unittest.test.testmock.support.X', new=object(), x=1)
-+        @patch('test.test_unittest.testmock.support.X', new=object(), x=1)
-         def test(): pass
-         with self.assertRaises(TypeError):
-             test()
-diff --git a/Lib/unittest/test/testmock/testsealable.py b/Lib/test/test_unittest/testmock/testsealable.py
-similarity index 100%
-rename from Lib/unittest/test/testmock/testsealable.py
-rename to Lib/test/test_unittest/testmock/testsealable.py
-diff --git a/Lib/unittest/test/testmock/testsentinel.py b/Lib/test/test_unittest/testmock/testsentinel.py
-similarity index 100%
-rename from Lib/unittest/test/testmock/testsentinel.py
-rename to Lib/test/test_unittest/testmock/testsentinel.py
-diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/test/test_unittest/testmock/testwith.py
-similarity index 99%
-rename from Lib/unittest/test/testmock/testwith.py
-rename to Lib/test/test_unittest/testmock/testwith.py
-index c74d49a63c..8dc8eb1137 100644
---- a/Lib/unittest/test/testmock/testwith.py
-+++ b/Lib/test/test_unittest/testmock/testwith.py
-@@ -1,7 +1,7 @@
- import unittest
- from warnings import catch_warnings
- 
--from unittest.test.testmock.support import is_instance
-+from test.test_unittest.testmock.support import is_instance
- from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call
- 
- 
-diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py
-index 005d23f6d0..b8de8c95d6 100644
---- a/Lib/unittest/__init__.py
-+++ b/Lib/unittest/__init__.py
-@@ -73,16 +73,6 @@ def testMultiply(self):
- _TextTestResult = TextTestResult
- 
- 
--# There are no tests here, so don't try to run anything discovered from
--# introspecting the symbols (e.g. FunctionTestCase). Instead, all our
--# tests come from within unittest.test.
--def load_tests(loader, tests, pattern):
--    import os.path
--    # top level directory cached on loader instance
--    this_dir = os.path.dirname(__file__)
--    return loader.discover(start_dir=this_dir, pattern=pattern)
--
--
- # Lazy import of IsolatedAsyncioTestCase from .async_case
- # It imports asyncio, which is relatively heavy, but most tests
- # do not need it.
-diff --git a/Lib/unittest/test/__init__.py b/Lib/unittest/test/__init__.py
-deleted file mode 100644
-index 143f4ab5a3..0000000000
---- a/Lib/unittest/test/__init__.py
-+++ /dev/null
-@@ -1,25 +0,0 @@
--import os
--import sys
--import unittest
--
--
--here = os.path.dirname(__file__)
--loader = unittest.defaultTestLoader
--
--def suite():
--    suite = unittest.TestSuite()
--    for fn in os.listdir(here):
--        if fn.startswith("test") and fn.endswith(".py"):
--            modname = "unittest.test." + fn[:-3]
--            try:
--                __import__(modname)
--            except unittest.SkipTest:
--                continue
--            module = sys.modules[modname]
--            suite.addTest(loader.loadTestsFromModule(module))
--    suite.addTest(loader.loadTestsFromName('unittest.test.testmock'))
--    return suite
--
--
--if __name__ == "__main__":
--    unittest.main(defaultTest="suite")
-diff --git a/Lib/unittest/test/__main__.py b/Lib/unittest/test/__main__.py
-deleted file mode 100644
-index 44d0591e84..0000000000
---- a/Lib/unittest/test/__main__.py
-+++ /dev/null
-@@ -1,18 +0,0 @@
--import os
--import unittest
--
--
--def load_tests(loader, standard_tests, pattern):
--    # top level directory cached on loader instance
--    this_dir = os.path.dirname(__file__)
--    pattern = pattern or "test_*.py"
--    # We are inside unittest.test, so the top-level is two notches up
--    top_level_dir = os.path.dirname(os.path.dirname(this_dir))
--    package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
--                                    top_level_dir=top_level_dir)
--    standard_tests.addTests(package_tests)
--    return standard_tests
--
--
--if __name__ == '__main__':
--    unittest.main()
-diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj
-index 692b083349..f3f44d1d8f 100644
---- a/PCbuild/lib.pyproj
-+++ b/PCbuild/lib.pyproj
-@@ -1491,33 +1491,33 @@
-     <Compile Include="unittest\runner.py" />
-     <Compile Include="unittest\signals.py" />
-     <Compile Include="unittest\suite.py" />
--    <Compile Include="unittest\test\dummy.py" />
--    <Compile Include="unittest\test\support.py" />
--    <Compile Include="unittest\test\testmock\support.py" />
--    <Compile Include="unittest\test\testmock\testcallable.py" />
--    <Compile Include="unittest\test\testmock\testhelpers.py" />
--    <Compile Include="unittest\test\testmock\testmagicmethods.py" />
--    <Compile Include="unittest\test\testmock\testmock.py" />
--    <Compile Include="unittest\test\testmock\testpatch.py" />
--    <Compile Include="unittest\test\testmock\testsentinel.py" />
--    <Compile Include="unittest\test\testmock\testwith.py" />
--    <Compile Include="unittest\test\testmock\__init__.py" />
--    <Compile Include="unittest\test\testmock\__main__.py" />
--    <Compile Include="unittest\test\test_assertions.py" />
--    <Compile Include="unittest\test\test_break.py" />
--    <Compile Include="unittest\test\test_case.py" />
--    <Compile Include="unittest\test\test_discovery.py" />
--    <Compile Include="unittest\test\test_functiontestcase.py" />
--    <Compile Include="unittest\test\test_loader.py" />
--    <Compile Include="unittest\test\test_program.py" />
--    <Compile Include="unittest\test\test_result.py" />
--    <Compile Include="unittest\test\test_runner.py" />
--    <Compile Include="unittest\test\test_setups.py" />
--    <Compile Include="unittest\test\test_skipping.py" />
--    <Compile Include="unittest\test\test_suite.py" />
--    <Compile Include="unittest\test\_test_warnings.py" />
--    <Compile Include="unittest\test\__init__.py" />
--    <Compile Include="unittest\test\__main__.py" />
-+    <Compile Include="test\test_unittest\dummy.py" />
-+    <Compile Include="test\test_unittest\support.py" />
-+    <Compile Include="test\test_unittest\testmock\support.py" />
-+    <Compile Include="test\test_unittest\testmock\testcallable.py" />
-+    <Compile Include="test\test_unittest\testmock\testhelpers.py" />
-+    <Compile Include="test\test_unittest\testmock\testmagicmethods.py" />
-+    <Compile Include="test\test_unittest\testmock\testmock.py" />
-+    <Compile Include="test\test_unittest\testmock\testpatch.py" />
-+    <Compile Include="test\test_unittest\testmock\testsentinel.py" />
-+    <Compile Include="test\test_unittest\testmock\testwith.py" />
-+    <Compile Include="test\test_unittest\testmock\__init__.py" />
-+    <Compile Include="test\test_unittest\testmock\__main__.py" />
-+    <Compile Include="test\test_unittest\test_assertions.py" />
-+    <Compile Include="test\test_unittest\test_break.py" />
-+    <Compile Include="test\test_unittest\test_case.py" />
-+    <Compile Include="test\test_unittest\test_discovery.py" />
-+    <Compile Include="test\test_unittest\test_functiontestcase.py" />
-+    <Compile Include="test\test_unittest\test_loader.py" />
-+    <Compile Include="test\test_unittest\test_program.py" />
-+    <Compile Include="test\test_unittest\test_result.py" />
-+    <Compile Include="test\test_unittest\test_runner.py" />
-+    <Compile Include="test\test_unittest\test_setups.py" />
-+    <Compile Include="test\test_unittest\test_skipping.py" />
-+    <Compile Include="test\test_unittest\test_suite.py" />
-+    <Compile Include="test\test_unittest\_test_warnings.py" />
-+    <Compile Include="test\test_unittest\__init__.py" />
-+    <Compile Include="test\test_unittest\__main__.py" />
-     <Compile Include="unittest\util.py" />
-     <Compile Include="unittest\__init__.py" />
-     <Compile Include="unittest\__main__.py" />
-@@ -1804,6 +1804,8 @@
-     <Folder Include="test\test_json" />
-     <Folder Include="test\test_peg_generator" />
-     <Folder Include="test\test_tools" />
-+    <Folder Include="test\test_unittest" />
-+    <Folder Include="test\test_unittest\testmock" />
-     <Folder Include="test\test_warnings" />
-     <Folder Include="test\test_warnings\data" />
-     <Folder Include="test\tracedmodules" />
-@@ -1813,8 +1815,6 @@
-     <Folder Include="tkinter\test\test_ttk" />
-     <Folder Include="turtledemo" />
-     <Folder Include="unittest" />
--    <Folder Include="unittest\test" />
--    <Folder Include="unittest\test\testmock" />
-     <Folder Include="urllib" />
-     <Folder Include="venv" />
-     <Folder Include="wsgiref" />
-diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py
-index d0a0570840..67afde60f0 100755
---- a/Tools/wasm/wasm_assets.py
-+++ b/Tools/wasm/wasm_assets.py
-@@ -112,7 +112,6 @@
- # regression test sub directories
- OMIT_SUBDIRS = (
-     "tkinter/test/",
--    "unittest/test/",
- )
- 
- def get_builddir(args: argparse.Namespace) -> pathlib.Path:
--- 
-2.29.2.windows.2
-
diff --git a/packages/test/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch b/packages/test/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch
deleted file mode 100644
--- a/packages/test/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 50ebd72fb0e69c78f95cea3d4a47589beb91ac37 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Tue, 21 Jun 2022 14:51:39 +0200
-Subject: [PATCH 7/9] gh-93839: Use load_package_tests() for testmock (GH-94055)
-
-Fixes failing tests on WebAssembly platforms.
-
-Automerge-Triggered-By: GH:tiran
----
- Lib/test/test_unittest/testmock/__init__.py | 17 +++--------------
- 1 file changed, 3 insertions(+), 14 deletions(-)
-
-diff --git a/Lib/test/test_unittest/testmock/__init__.py b/Lib/test/test_unittest/testmock/__init__.py
-index 6ee60b2376..bc502ef32d 100644
---- a/Lib/test/test_unittest/testmock/__init__.py
-+++ b/Lib/test/test_unittest/testmock/__init__.py
-@@ -1,17 +1,6 @@
--import os
--import sys
--import unittest
-+import os.path
-+from test.support import load_package_tests
- 
- 
--here = os.path.dirname(__file__)
--loader = unittest.defaultTestLoader
--
- def load_tests(*args):
--    suite = unittest.TestSuite()
--    for fn in os.listdir(here):
--        if fn.startswith("test") and fn.endswith(".py"):
--            modname = "test.test_unittest.testmock." + fn[:-3]
--            __import__(modname)
--            module = sys.modules[modname]
--            suite.addTest(loader.loadTestsFromModule(module))
--    return suite
-+    return load_package_tests(os.path.dirname(__file__), *args)
--- 
-2.29.2.windows.2
-
diff --git a/packages/test/patches/0008-Move-test-directories.patch b/packages/test/patches/0008-Move-test-directories.patch
deleted file mode 100644
--- a/packages/test/patches/0008-Move-test-directories.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 4c71c808cc65ed6003b1e29d583c71586ebb36e1 Mon Sep 17 00:00:00 2001
-From: ryanking13 <def6488@gmail.com>
-Date: Wed, 25 Jan 2023 15:54:16 +0900
-Subject: [PATCH 8/9] Move test directories
-
----
- Makefile.pre.in | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index b356f6293e..68c55a356a 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1932,8 +1932,7 @@ LIBSUBDIRS=	asyncio \
- 		xmlrpc \
- 		zoneinfo \
- 		__phello__
--TESTSUBDIRS=	ctypes/test \
--		distutils/tests \
-+TESTSUBDIRS= distutils/tests \
- 		idlelib/idle_test \
- 		lib2to3/tests \
- 		lib2to3/tests/data \
-@@ -2009,7 +2008,8 @@ TESTSUBDIRS=	ctypes/test \
- 		test/ziptestdata \
- 		tkinter/test tkinter/test/test_tkinter \
- 		tkinter/test/test_ttk \
--		unittest/test unittest/test/testmock
-+		test/test_ctypes \
-+		test/test_unittest test/test_unittest/testmock
- 
- TEST_MODULES=@TEST_MODULES@
- libinstall:	all $(srcdir)/Modules/xxmodule.c
--- 
-2.29.2.windows.2
-
diff --git a/packages/wrapt/test_wrapt.py b/packages/wrapt/test_wrapt.py
--- a/packages/wrapt/test_wrapt.py
+++ b/packages/wrapt/test_wrapt.py
@@ -79,5 +79,5 @@ def _function(*args, **kwargs):
             self.assertEqual(result, (_args, _kwargs))
 
     # Run tests
-    with unittest.TestCase().assertRaisesRegex(SystemExit, "False"):
+    with unittest.TestCase().assertRaisesRegex(SystemExit, "5"):
         unittest.main()
diff --git a/pyodide-build/pyodide_build/tests/_test_recipes/joblib/meta.yaml b/pyodide-build/pyodide_build/tests/_test_recipes/joblib/meta.yaml
--- a/pyodide-build/pyodide_build/tests/_test_recipes/joblib/meta.yaml
+++ b/pyodide-build/pyodide_build/tests/_test_recipes/joblib/meta.yaml
@@ -2,10 +2,6 @@ package:
   name: joblib
   version: 1.1.0
 
-requirements:
-  run:
-    - distutils
-
 source:
   url: https://files.pythonhosted.org/packages/92/b9/9e3616e7e00c8165fb25175c53444533bdde05f3e974d45d9fcbbe451ee6/joblib-1.1.0.tar.gz
   sha256: 4158fcecd13733f8be669be0683b96ebdbbd38d23559f54dca7205aea1bf1e35
diff --git a/pyodide-build/pyodide_build/tests/fixture.py b/pyodide-build/pyodide_build/tests/fixture.py
--- a/pyodide-build/pyodide_build/tests/fixture.py
+++ b/pyodide-build/pyodide_build/tests/fixture.py
@@ -18,7 +18,6 @@ def temp_python_lib(tmp_path_factory):
 
     (path / "test").mkdir()
     (path / "test" / "test_blah.py").touch()
-    (path / "distutils").mkdir()
     (path / "turtle.py").touch()
 
     (path / "module1.py").touch()
diff --git a/pyodide-build/pyodide_build/tests/test_pyzip.py b/pyodide-build/pyodide_build/tests/test_pyzip.py
--- a/pyodide-build/pyodide_build/tests/test_pyzip.py
+++ b/pyodide-build/pyodide_build/tests/test_pyzip.py
@@ -8,7 +8,7 @@
 def test_defaultfilterfunc(temp_python_lib):
     filterfunc = default_filterfunc(temp_python_lib, verbose=True)
 
-    ignored = ["test", "distutils", "turtle.py"]
+    ignored = ["test", "turtle.py"]
     assert set(ignored) == filterfunc(str(temp_python_lib), ignored)
 
     assert set() == filterfunc(str(temp_python_lib), ["hello.py", "world.py"])
diff --git a/src/tests/python_tests.yaml b/src/tests/python_tests.yaml
--- a/src/tests/python_tests.yaml
+++ b/src/tests/python_tests.yaml
@@ -28,7 +28,7 @@
 # - multiprocessing: Fails due to no multiprocessing implementation.
 # - fs: Fails due to virtual filesystem issues.
 # - nonsense: This functionality doesn't make sense in this context. Includes
-#   things like `pip`, `distutils`
+#   things like `pip`
 # - crash: The Python interpreter just stopped without a traceback. Will require
 #   further investigation. This usually seems to be caused by calling into a
 #   system function that doesn't behave as one would expect.
@@ -36,15 +36,18 @@
 # - crash-firefox: Same as crash but only affecting Firefox
 - leakers.test_ctypes
 - leakers.test_selftype
+- regrtestdata.import_from_tests.test_regrtest_a:
+    xfail: didn't correctly embed test data
+- regrtestdata.import_from_tests.test_regrtest_c:
+    xfail: didn't correctly embed test data
 - test___all__:
     xfail: multiprocessing
-- test___future__:
-    xfail: Dunno
 - test__locale:
     xfail: locale
 - test__opcode
 - test__osx_support:
     xfail: platform-specific
+- test__xxinterpchannels
 - test__xxsubinterpreters:
     xfail: hits Py_FatalError("not the last thread") inside Py_EndInterpreter
 - test_abc
@@ -55,20 +58,18 @@
 - test_array
 - test_asdl_parser
 - test_ast:
+    xfail-safari: Stack overflow
     skip:
       - test_stdlib_validates # incompatible with zipimport
 - test_asyncgen:
     xfail: async
-- test_asynchat:
-    xfail: async
-- test_asyncio.test_asyncio_waitfor:
-    xfail: async
 - test_asyncio.test_base_events:
     xfail: async
 - test_asyncio.test_buffered_proto:
     xfail: async
 - test_asyncio.test_context:
     xfail: async
+- test_asyncio.test_eager_task_factory
 - test_asyncio.test_events:
     xfail: async
 - test_asyncio.test_futures:
@@ -106,13 +107,13 @@
     xfail: async
 - test_asyncio.test_threads:
     xfail: async
+- test_asyncio.test_timeouts
 - test_asyncio.test_transports
 - test_asyncio.test_unix_events:
     xfail: async
+- test_asyncio.test_waitfor
 - test_asyncio.test_windows_events
 - test_asyncio.test_windows_utils
-- test_asyncore:
-    xfail: async
 - test_atexit:
     skip:
       - test_general # fork
@@ -159,15 +160,35 @@
       - testThreading
 - test_c_locale_coercion
 - test_calendar
-- test_call
-- test_capi:
-    xfail: hangs
+- test_call:
+    xfail: stack overflow
+- test_capi.test_abstract
+- test_capi.test_bytearray
+- test_capi.test_bytes
+- test_capi.test_codecs
+- test_capi.test_complex
+- test_capi.test_dict
+- test_capi.test_eval_code_ex
+- test_capi.test_exceptions
+- test_capi.test_float
+- test_capi.test_getargs
+- test_capi.test_immortal
+- test_capi.test_list
+- test_capi.test_long
+- test_capi.test_mem
+- test_capi.test_misc:
+    skip:
+      - "*subinterpreter*" # Should we disable _xxsubinterpreters in Setup.local?
+- test_capi.test_set
+- test_capi.test_structmembers
+- test_capi.test_sys
+- test_capi.test_unicode
+- test_capi.test_watchers
 - test_cgi:
     skip:
       - test_log # OSError: [Errno 70] Invalid seek
 - test_cgitb
 - test_charmapcodec
-- test_check_c_globals
 - test_class
 - test_clinic
 - test_cmath
@@ -198,8 +219,17 @@
 - test_compile
 - test_compileall:
     xfail: multiprocessing
+- test_compiler_assemble
+- test_compiler_codegen
 - test_complex
-- test_concurrent_futures
+- test_concurrent_futures.test_as_completed
+- test_concurrent_futures.test_deadlock
+- test_concurrent_futures.test_future
+- test_concurrent_futures.test_init
+- test_concurrent_futures.test_process_pool
+- test_concurrent_futures.test_shutdown
+- test_concurrent_futures.test_thread_pool
+- test_concurrent_futures.test_wait
 - test_configparser
 - test_contains
 - test_context:
@@ -217,12 +247,60 @@
 - test_crashers
 - test_crypt
 - test_csv
-- test_ctypes:
+- test_ctypes.test_anon
+- test_ctypes.test_array_in_pointer
+- test_ctypes.test_arrays
+- test_ctypes.test_as_parameter
+- test_ctypes.test_bitfields
+- test_ctypes.test_buffers
+- test_ctypes.test_bytes
+- test_ctypes.test_byteswap
+- test_ctypes.test_callbacks
+- test_ctypes.test_cast
+- test_ctypes.test_cfuncs
+- test_ctypes.test_checkretval
+- test_ctypes.test_delattr
+- test_ctypes.test_errno
+- test_ctypes.test_find
+- test_ctypes.test_frombuffer
+- test_ctypes.test_funcptr
+- test_ctypes.test_functions
+- test_ctypes.test_incomplete
+- test_ctypes.test_init
+- test_ctypes.test_internals
+- test_ctypes.test_keeprefs
+- test_ctypes.test_libc
+- test_ctypes.test_loading
+- test_ctypes.test_macholib
+- test_ctypes.test_memfunctions
+- test_ctypes.test_numbers
+- test_ctypes.test_objects
+- test_ctypes.test_parameters
+- test_ctypes.test_pep3118
+- test_ctypes.test_pickling
+- test_ctypes.test_pointers
+- test_ctypes.test_prototypes
+- test_ctypes.test_python_api
+- test_ctypes.test_random_things
+- test_ctypes.test_refcounts
+- test_ctypes.test_repr
+- test_ctypes.test_returnfuncptrs
+- test_ctypes.test_simplesubclasses
+- test_ctypes.test_sizes
+- test_ctypes.test_slicing
+- test_ctypes.test_stringptr
+- test_ctypes.test_strings
+- test_ctypes.test_struct_fields
+- test_ctypes.test_structures:
     skip:
-      # See https://bugs.python.org/issue47208
-      - test_callback_too_many_args
+      - test_array_in_struct_registers # needs https://github.com/libffi/libffi/pull/818
+- test_ctypes.test_unaligned_structures
+- test_ctypes.test_unicode
+- test_ctypes.test_values
+- test_ctypes.test_varsize_struct
+- test_ctypes.test_win32
+- test_ctypes.test_wintypes
 - test_curses
-- test_dataclasses
 - test_datetime:
     xfail: strftime
 - test_dbm:
@@ -238,7 +316,8 @@
 - test_decorators
 - test_defaultdict
 - test_deque
-- test_descr
+- test_descr:
+    xfail: stack overflow
 - test_descrtut
 - test_devpoll
 - test_dict
@@ -247,9 +326,6 @@
 - test_dictviews
 - test_difflib
 - test_dis
-- test_distutils:
-    # error while loading tests ModuleNotFoundError: No module named '_osx_support'
-    xfail: nonsense
 - test_doctest:
     xfail: subprocess
 - test_doctest2
@@ -333,19 +409,20 @@
 - test_functools:
     skip:
       - "*threaded*"
-- test_future:
-    xfail: Dunno
-- test_future3:
-    xfail: Dunno
-- test_future4:
-    xfail: Dunno
-- test_future5:
-    xfail: Dunno
+- test_future_stmt.test_future
+- test_future_stmt.test_future_flags
+- test_future_stmt.test_future_multiple_features
+- test_future_stmt.test_future_multiple_imports
+- test_future_stmt.test_future_single_import
 - test_gc:
     skip:
       - test_garbage_at_shutdown
       - test_trashcan_threads
-- test_gdb
+- test_gdb.test_backtrace
+- test_gdb.test_cfunction
+- test_gdb.test_cfunction_full
+- test_gdb.test_misc
+- test_gdb.test_pretty_print
 - test_generator_stop
 - test_generators
 - test_genericalias:
@@ -357,8 +434,6 @@
       - test_samestat_on_link
       - test_exists_fd
 - test_genexps
-- test_getargs2:
-    xfail: Not sure
 - test_getopt
 - test_getpass
 - test_getpath
@@ -394,17 +469,14 @@
 - test_imaplib:
     xfail: socket
 - test_imghdr
-- test_imp:
-    skip:
-      # incompatible with zipimport
-      - test_multiple_calls_to_get_data
-      - test_issue1267
-      - test_load_from_source
 - test_importlib.builtin.test_finder
 - test_importlib.builtin.test_loader
 - test_importlib.extension.test_case_sensitivity
-- test_importlib.extension.test_finder
-- test_importlib.extension.test_loader
+- test_importlib.extension.test_finder:
+    skip:
+      - "*FinderTests.test_module"
+- test_importlib.extension.test_loader:
+    xfail: "TODO: why does it fail?"
 - test_importlib.extension.test_path_hook
 - test_importlib.frozen.test_finder
 - test_importlib.frozen.test_loader
@@ -413,10 +485,20 @@
 - test_importlib.import_.test_api
 - test_importlib.import_.test_caching
 - test_importlib.import_.test_fromlist
+- test_importlib.import_.test_helpers
 - test_importlib.import_.test_meta_path
 - test_importlib.import_.test_packages
 - test_importlib.import_.test_path
 - test_importlib.import_.test_relative_imports
+- test_importlib.resources.test_compatibilty_files
+- test_importlib.resources.test_contents
+- test_importlib.resources.test_custom
+- test_importlib.resources.test_files
+- test_importlib.resources.test_open
+- test_importlib.resources.test_path
+- test_importlib.resources.test_read
+- test_importlib.resources.test_reader
+- test_importlib.resources.test_resource
 - test_importlib.source.test_case_sensitivity
 - test_importlib.source.test_file_loader
 - test_importlib.source.test_finder
@@ -427,21 +509,13 @@
     skip:
       # incompatible with zipimport
       - test_reload_missing_loader
-- test_importlib.test_compatibilty_files
-- test_importlib.test_contents
-- test_importlib.test_files
 - test_importlib.test_lazy
 - test_importlib.test_locks:
     xfail: threading
 - test_importlib.test_main
 - test_importlib.test_metadata_api
 - test_importlib.test_namespace_pkgs
-- test_importlib.test_open
-- test_importlib.test_path
 - test_importlib.test_pkg_import
-- test_importlib.test_read
-- test_importlib.test_reader
-- test_importlib.test_resource
 - test_importlib.test_spec
 - test_importlib.test_threaded_import:
     xfail: threading
@@ -449,9 +523,7 @@
 - test_importlib.test_windows
 - test_importlib.test_zip
 - test_index
-- test_inspect:
-    skip:
-      - test_nested_class_definition_inside_async_function
+- test_inspect.test_inspect
 - test_int
 - test_int_literal
 - test_interpreters:
@@ -491,8 +563,21 @@
 - test_kqueue
 - test_largefile:
     xfail: segfault-outofmemory ("Array buffer allocation failed")
-- test_lib2to3:
-    xfail: nonsense
+- test_launcher
+- test_lib2to3.test_all_fixers:
+    xfail: removed
+- test_lib2to3.test_fixers:
+    xfail: removed
+- test_lib2to3.test_main:
+    xfail: removed
+- test_lib2to3.test_parser:
+    xfail: removed
+- test_lib2to3.test_pytree:
+    xfail: removed
+- test_lib2to3.test_refactor:
+    xfail: removed
+- test_lib2to3.test_util:
+    xfail: removed
 - test_linecache:
     skip:
       # incompatible with zipimport
@@ -517,6 +602,7 @@
       - test_test # not sure why it fails...
 - test_marshal
 - test_math
+- test_math_property
 - test_memoryio
 - test_memoryview
 - test_metaclass
@@ -529,14 +615,24 @@
       - test_basic
       - test_offset
       - test_resize_past_pos
-- test_module
-- test_modulefinder
+- test_modulefinder:
+    xfail: takes a long time
+- test_monitoring
 - test_msilib
 - test_multibytecodec
-- test_multiprocessing_fork
-- test_multiprocessing_forkserver
+- test_multiprocessing_fork.test_manager
+- test_multiprocessing_fork.test_misc
+- test_multiprocessing_fork.test_processes
+- test_multiprocessing_fork.test_threads
+- test_multiprocessing_forkserver.test_manager
+- test_multiprocessing_forkserver.test_misc
+- test_multiprocessing_forkserver.test_processes
+- test_multiprocessing_forkserver.test_threads
 - test_multiprocessing_main_handling
-- test_multiprocessing_spawn
+- test_multiprocessing_spawn.test_manager
+- test_multiprocessing_spawn.test_misc
+- test_multiprocessing_spawn.test_processes
+- test_multiprocessing_spawn.test_threads
 - test_named_expressions
 - test_netrc
 - test_nis
@@ -580,6 +676,9 @@
 - test_peg_generator.test_first_sets
 - test_peg_generator.test_grammar_validator
 - test_peg_generator.test_pegen
+- test_pep646_syntax
+- test_perf_profiler
+- test_perfmaps
 - test_pickle:
     xfail: dbm
 - test_picklebuffer
@@ -591,7 +690,8 @@
 - test_platform:
     skip:
       - test_architecture_via_symlink # fork
-- test_plistlib
+- test_plistlib:
+    xfail: stack overflow
 - test_poll:
     xfail: subprocess
 - test_popen:
@@ -653,7 +753,7 @@
 - test_runpy:
     skip:
       - test_pymain_run* # fork
-      # incompatible with zipimport
+        # incompatible with zipimport
       - test_run_module
       - test_run_module_alter_sys
       - test_run_module_in_namespace_package
@@ -698,7 +798,6 @@
 - test_site:
     xfail: "TypeError: unhashable type: 'pyodide.JsProxy'"
 - test_slice
-- test_smtpd
 - test_smtplib:
     xfail: sockets
 - test_smtpnet
@@ -713,6 +812,7 @@
       - test_20731
 - test_spwd
 - test_sqlite3.test_backup
+- test_sqlite3.test_cli
 - test_sqlite3.test_dbapi
 - test_sqlite3.test_dump
 - test_sqlite3.test_factory
@@ -738,15 +838,12 @@
       - test_timezone
 - test_strtod
 - test_struct
-- test_structmembers:
-    xfail: Not sure
 - test_structseq
 - test_subclassinit
 - test_subprocess:
     xfail: subprocess
 - test_sunau
-- test_sundry:
-    xfail: Dunno
+- test_sundry
 - test_super
 - test_support:
     xfail: about half the tests fork
@@ -763,14 +860,12 @@
 - test_syslog
 - test_tabnanny
 - test_tarfile:
-    xfail: Dunno
     skip:
-      - test_file_mode
+      - test_chains
+      - test_deep_symlink
+      - test_sly_relative*
       - test_extractall*
-      - test_link_size
-      - test_dereference_hardlink
-      - test_add_hardlink
-      - test_add_twice
+      - test_parent_symlink*
 - test_tcl
 - test_telnetlib:
     xfail: 7/19 fail with sockets
@@ -780,6 +875,7 @@
       - test_process_awareness # fork
       - test_truncate_with_size_parameter # setup failure FileNotFoundError: [Errno 44] No such file or directory
       - test_noinherit # self.assertEqual(os.get_inheritable(file.fd), False) ==> AssertionError: True != False
+- test_termios
 - test_textwrap
 - test_thread:
     xfail: threading
@@ -803,17 +899,23 @@
 - test_timeit
 - test_timeout
 - test_tix
-- test_tk
+- test_tkinter.test_colorchooser
+- test_tkinter.test_font
+- test_tkinter.test_geometry_managers
+- test_tkinter.test_images
+- test_tkinter.test_loadtk
+- test_tkinter.test_messagebox
+- test_tkinter.test_misc
+- test_tkinter.test_simpledialog
+- test_tkinter.test_text
+- test_tkinter.test_variables
+- test_tkinter.test_widgets
 - test_tokenize
-- test_tools.test_fixcid
+- test_tomllib.test_data
+- test_tomllib.test_error
+- test_tomllib.test_misc
 - test_tools.test_freeze
-- test_tools.test_gprof2html
 - test_tools.test_i18n
-- test_tools.test_lll
-- test_tools.test_md5sum
-- test_tools.test_pathfix
-- test_tools.test_pdeps
-- test_tools.test_pindent
 - test_tools.test_reindent
 - test_tools.test_sundry
 - test_trace:
@@ -821,15 +923,21 @@
 - test_traceback:
     skip:
       - test_encoded_file # fork
+      - test_import_from* # tries to write to stdlib but it's in a zip
 - test_tracemalloc
-- test_ttk_guionly
+- test_ttk.test_extensions
+- test_ttk.test_style
+- test_ttk.test_widgets
 - test_ttk_textonly
+- test_tty
 - test_tuple:
     xfail-chrome: times out
 - test_turtle
+- test_type_aliases
 - test_type_annotations
 - test_type_cache
 - test_type_comments
+- test_type_params
 - test_typechecks
 - test_types
 - test_typing:
@@ -844,18 +952,19 @@
 - test_unicode_file_functions
 - test_unicode_identifiers
 - test_unicodedata
-- test_unittest:
-    xfail: Dunno
-    skip:
-      - "*async*"
-      - "*Interrupt*"
-      - "*Handler*"
-        # os.kill
-      - testTwoResults
-      - test_warnings
-      - testRemoveResult
-        # fork
-      - testSelectedTestNamesFunctionalTest
+- test_unittest.test_assertions
+- test_unittest.test_async_case
+- test_unittest.test_break
+- test_unittest.test_case
+- test_unittest.test_discovery
+- test_unittest.test_functiontestcase
+- test_unittest.test_loader
+- test_unittest.test_program
+- test_unittest.test_result
+- test_unittest.test_runner
+- test_unittest.test_setups
+- test_unittest.test_skipping
+- test_unittest.test_suite
 - test_univnewlines
 - test_unpack
 - test_unpack_ex
@@ -896,16 +1005,15 @@
 - test_winreg
 - test_winsound
 - test_with
+- test_wmi
 - test_wsgiref
 - test_xdrlib
 - test_xml_dom_minicompat
 - test_xml_etree:
-    xfail: Dunno
     skip:
       # stack overflow in v8
-      - "test_recursive_repr"
-- test_xml_etree_c:
-    xfail: Dunno
+      - test_recursive_repr
+- test_xml_etree_c
 - test_xmlrpc:
     xfail: networking
 - test_xmlrpc_net
@@ -913,12 +1021,17 @@
 - test_xxtestfuzz
 - test_yield_from
 - test_zipapp
-- test_zipfile:
-    xfail-chrome: times out
+- test_zipfile._path.test_complexity
+- test_zipfile._path.test_path
+- test_zipfile.test_core:
+    xfail: Times out
     skip:
-      - test_many_opens # [Errno 54] Not a directory: '/proc/self/fd'
+      # NotADirectoryError: [Errno 54] Not a directory: '/proc/self/fd'
+      - test_many_opens
+
 - test_zipfile64
 - test_zipimport
 - test_zipimport_support
 - test_zlib
 - test_zoneinfo.test_zoneinfo
+- test_zoneinfo.test_zoneinfo_property