Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest 8.0.0 AttributeError: 'Package' object has no attribute 'obj' #763

Closed
tandav opened this issue Jan 28, 2024 · 2 comments
Closed

pytest 8.0.0 AttributeError: 'Package' object has no attribute 'obj' #763

tandav opened this issue Jan 28, 2024 · 2 comments
Milestone

Comments

@tandav
Copy link

tandav commented Jan 28, 2024

pytest-asyncio started throwing error since pytest 8.0.0

platform linux -- Python 3.12.1, pytest-8.0.0, pluggy-1.4.0
cachedir: .cache/pytest_cache
rootdir: /builds/tandav/musiclib
configfile: pyproject.toml
plugins: hypothesis-6.97.1, asyncio-0.23.3, cov-4.1.0
asyncio: mode=Mode.STRICT
collected 0 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 272, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 325, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 138, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/logging.py", line 783, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/warnings.py", line 118, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1365, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 336, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 799, in perform_collect
INTERNALERROR>     self.items.extend(self.genitems(node))
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 942, in genitems
INTERNALERROR>     yield from self.genitems(subnode)
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 942, in genitems
INTERNALERROR>     yield from self.genitems(subnode)
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 937, in genitems
INTERNALERROR>     rep, duplicate = self._collect_one_node(node, handle_dupes)
INTERNALERROR>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 825, in _collect_one_node
INTERNALERROR>     rep = collect_one_node(node)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/_pytest/runner.py", line 566, in collect_one_node
INTERNALERROR>     ihook.pytest_collectstart(collector=collector)
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 138, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/usr/local/lib/python3.12/site-packages/pytest_asyncio/plugin.py", line 626, in pytest_collectstart
INTERNALERROR>     pyobject = collector.obj
INTERNALERROR>                ^^^^^^^^^^^^^
INTERNALERROR> AttributeError: 'Package' object has no attribute 'obj'
============================ no tests ran in 0.05s =============================

the issue in pytest repo: pytest-dev/pytest#11868

@dolfinus
Copy link

dolfinus commented Jan 28, 2024

It looks the same as #737

@seifertm
Copy link
Contributor

Thanks for the cross-reference with the issue in the pytest bug tracker.

Pytest 8 has introduced changes to the way test collection works. Pytest-asyncio is currently not compatible with those changes. It's a rather high priority, though, in order to allow users to upgrade.

I'm closing this as a duplicate of #737.

@seifertm seifertm closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2024
@seifertm seifertm added this to the v0.24 milestone Jan 28, 2024
pentschev added a commit to pentschev/ucx-py that referenced this issue Jan 29, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in
the process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should
also be done directly by `pytest-asyncio>=0.23.4`, but that version is
still not available in conda-forge.
pentschev added a commit to pentschev/ucxx that referenced this issue Jan 29, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in
the process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should
also also be done directly by `pytest-asyncio>=0.23.4`, but that version
is still not available in conda-forge.
rapids-bot bot pushed a commit to rapidsai/ucx-py that referenced this issue Jan 29, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in the process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should also be done directly by `pytest-asyncio>=0.23.4`, but that version is still not available in conda-forge.

Authors:
  - Peter Andreas Entschev (https://github.com/pentschev)

Approvers:
  - Lawrence Mitchell (https://github.com/wence-)

URL: #1019
rapids-bot bot pushed a commit to rapidsai/ucxx that referenced this issue Jan 29, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in the process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should also also be done directly by `pytest-asyncio>=0.23.4`, but that version is still not available in conda-forge.

Authors:
  - Peter Andreas Entschev (https://github.com/pentschev)

Approvers:
  - Lawrence Mitchell (https://github.com/wence-)
  - Ray Douglass (https://github.com/raydouglass)

URL: #179
pentschev added a commit to pentschev/ucxx that referenced this issue Jan 30, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in
the process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should
also also be done directly by `pytest-asyncio>=0.23.4`, but that version
is still not available in conda-forge.
pentschev added a commit to pentschev/ucx-py that referenced this issue Jan 30, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in the
process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should
also be done directly by `pytest-asyncio>=0.23.4`, but that version
is still not available in conda-forge.
raydouglass pushed a commit to rapidsai/ucxx that referenced this issue Jan 30, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in
the process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should
also also be done directly by `pytest-asyncio>=0.23.4`, but that version
is still not available in conda-forge.
raydouglass pushed a commit to rapidsai/ucx-py that referenced this issue Jan 30, 2024
Pytest 8 introduced breaking changes that `pytest-asyncio` is still in the
process of resolving. See
pytest-dev/pytest-asyncio#763. This pin should
also be done directly by `pytest-asyncio>=0.23.4`, but that version
is still not available in conda-forge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants