Skip to content

Does not run with Python 3.11-dev #9181

@scop

Description

@scop

With 6.2.5 and current git main:

$ python3.11 -V
Python 3.11.0a1+
$ python3.11 -m pytest
Traceback (most recent call last):
  File "/home/scop/.pyenv/versions/pytest311/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 145, in __makeattr
    modpath, attrname = self.__map__[name]
                        ~~~~~~~~~~~~^^^^^^
KeyError: '__spec__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/scop/.pyenv/versions/3.11-dev/lib/python3.11/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/.pyenv/versions/3.11-dev/lib/python3.11/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/.pyenv/versions/3.11-dev/lib/python3.11/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
    ^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/Documents/code/pytest/src/pytest/__init__.py", line 3, in <module>
    from . import collect
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/Documents/code/pytest/src/pytest/collect.py", line 8, in <module>
    from _pytest.deprecated import PYTEST_COLLECT_MODULE
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/Documents/code/pytest/src/_pytest/deprecated.py", line 13, in <module>
    from _pytest.warning_types import PytestDeprecationWarning
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/Documents/code/pytest/src/_pytest/warning_types.py", line 8, in <module>
    from _pytest.compat import final
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/Documents/code/pytest/src/_pytest/compat.py", line 39, in <module>
    LEGACY_PATH = py.path. local
                  ^^^^^^^^^^^^^^
  File "/home/scop/.pyenv/versions/pytest311/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 152, in __makeattr
    result = importobj(modpath, attrname)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scop/.pyenv/versions/pytest311/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 72, in importobj
    module = __import__(modpath, None, None, ['__doc__'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1083, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1043, in _find_and_load_unlocked
  File "/home/scop/.pyenv/versions/pytest311/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 150, in __makeattr
    raise AttributeError(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: __spec__

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions