Skip to content

Deprecation warning in test_importlib #96280

Closed
@iritkatriel

Description

@iritkatriel
% ./python.exe -We -m test -v test_importlib
== CPython 3.12.0a0 (heads/main:caa2a9799a, Aug 25 2022, 18:44:45) [Clang 13.1.6 (clang-1316.0.21.2.5)]
== macOS-12.5.1-x86_64-i386-64bit little-endian
== cwd: /Users/iritkatriel/src/cpython-1/build/test_python_32671æ
== CPU count: 12
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 2.89 Run tests sequentially
0:00:00 load avg: 2.89 [1/1] test_importlib
Failed to import test module: test.test_importlib.test_abc
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-1/Lib/unittest/loader.py", line 385, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/unittest/loader.py", line 328, in _get_module_from_name
    __import__(name)
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/test_abc.py", line 323, in <module>
    class ResourceReaderDefaultsTests(ABCTestHarness):
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/test_abc.py", line 325, in ResourceReaderDefaultsTests
    SPLIT = make_abc_subclasses(ResourceReader)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/test_abc.py", line 131, in make_abc_subclasses
    base = {kind: getattr(splitabc, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/test_abc.py", line 131, in <dictcomp>
    base = {kind: getattr(splitabc, name)
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/importlib/abc.py", line 35, in __getattr__
    warnings._deprecated(f"{__name__}.{name}", remove=(3, 14))
  File "/Users/iritkatriel/src/cpython-1/Lib/warnings.py", line 514, in _deprecated
    warn(msg, DeprecationWarning, stacklevel=3)
DeprecationWarning: 'importlib.abc.ResourceReader' is deprecated and slated for removal in Python 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions