cpython/Lib/test/test_importlib
Filipe Laíns 157f271de3
gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900)
* gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix doc reference

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Remove specific doc references

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix docstrings

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Revert "Remove specific doc references"

This reverts commit 31d1a8f551.

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix news references

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Add docs warning

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Dedupe __path__ in PathFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Use context manager and add error handling to os.scandir

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Dedupe when package exists with multiple suffixes

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Apply suggestions from code review

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>

* Add tests

Signed-off-by: Filipe Laíns <lains@riseup.net>

---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2026-02-19 15:25:50 +00:00
..
builtin GH-97850: Remove all uses and definitions of load_module() from importlib (#142205) 2025-12-10 15:35:51 -08:00
extension GH-97850: Remove all uses and definitions of load_module() from importlib (#142205) 2025-12-10 15:35:51 -08:00
frozen gh-71339: Use new assertion methods in test_import and test_importlib (GH-129052) 2025-01-21 11:24:19 +02:00
import_ GH-65961: Stop setting __cached__ on modules (GH-142165) 2025-12-11 11:44:46 -08:00
metadata gh-143658: importlib.metadata: Use str.translate to improve performance of importlib.metadata.Prepared.normalized (#143660) 2026-01-13 08:54:15 +02:00
namespace_pkgs gh-93334: Fix homonym edge case in PathFinder.find_spec() (GH-98100) 2025-09-05 15:41:01 -07:00
partial
resources gh-138044: Remove deprecated parameter alias for importlib.resources.files (#138059) 2025-10-04 14:53:43 +01:00
source gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00
__init__.py
__main__.py
abc.py GH-97850: Remove all uses and definitions of load_module() from importlib (#142205) 2025-12-10 15:35:51 -08:00
test_abc.py gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00
test_api.py gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00
test_discover.py gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900) 2026-02-19 15:25:50 +00:00
test_lazy.py GH-139686: Revert "gh-139686: Make reloading a lazy module no-op (GH-139857)" (#143584) 2026-01-08 22:08:03 +00:00
test_locks.py gh-134322: Fix repr(threading.RLock) (#134389) 2025-05-22 16:46:57 +00:00
test_namespace_pkgs.py gh-93334: Fix homonym edge case in PathFinder.find_spec() (GH-98100) 2025-09-05 15:41:01 -07:00
test_pkg_import.py gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00
test_spec.py gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00
test_threaded_import.py gh-143650: Fix importlib race condition on import failure (GH-143651) 2026-02-10 14:08:33 +01:00
test_util.py gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00
test_windows.py gh-121604: fix warnings in test_importlib.test_abc and test_importlib.test_windows (GH-128904) 2025-01-16 13:29:16 -08:00
threaded_import_hangers.py
util.py gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293) 2026-02-10 00:01:17 +00:00