cpython/Lib/test/test_importlib
Brett Simmers c2627d6eea
gh-116322: Add Py_mod_gil module slot (#116882)
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.

PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.

A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
2024-05-03 11:30:55 -04:00
..
builtin gh-105407: Remove unused imports in tests (#105408) 2023-06-06 22:50:43 +02:00
extension gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
frozen gh-105407: Remove unused imports in tests (#105408) 2023-06-06 22:50:43 +02:00
import_ gh-112414: Add additional unit tests for calling `repr()` on a namespace package (#112475) 2023-11-28 00:09:59 +00:00
metadata gh-117089: Apply changes from importlib_metadata 7.1.0 (#117094) 2024-03-20 23:01:24 -04:00
namespace_pkgs
partial
resources gh-116608: Ignore UTF-16 BOM in importlib.resources._functional tests (GH-117569) 2024-04-05 17:00:29 +02:00
source gh-105407: Remove unused imports in tests (#105408) 2023-06-06 22:50:43 +02:00
__init__.py
__main__.py
abc.py
test_abc.py gh-98040: Remove find_loader, find_module and other deprecated APIs (#98059) 2023-05-03 04:55:22 -07:00
test_api.py gh-105407: Remove unused imports in tests (#105408) 2023-06-06 22:50:43 +02:00
test_lazy.py gh-117182: Allow lazily loaded modules to modify their own __class__ 2024-04-09 04:08:48 +01:00
test_locks.py gh-109974: Fix more threading lock_tests race conditions (#110089) 2023-09-29 12:21:18 +00:00
test_namespace_pkgs.py gh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported with a custom loader (#112425) 2023-11-27 08:19:29 +00:00
test_pkg_import.py
test_spec.py GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754) 2024-03-13 13:24:28 -07:00
test_threaded_import.py gh-116622: Test updates for Android (#117299) 2024-04-05 20:57:36 +00:00
test_util.py gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791) 2024-04-24 16:18:24 +00:00
test_windows.py gh-112535: Add test on _Py_ThreadId() (#112709) 2023-12-04 22:40:06 +00:00
threaded_import_hangers.py
util.py gh-116303: Skip test module dependent tests if test modules are unavailable (#117341) 2024-04-03 15:11:36 +02:00