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

Can't run tests on python 3.11 #185

Open
beenje opened this issue Nov 4, 2022 · 2 comments
Open

Can't run tests on python 3.11 #185

beenje opened this issue Nov 4, 2022 · 2 comments

Comments

@beenje
Copy link

beenje commented Nov 4, 2022

______________________ ERROR collecting tests/rpc_test.py ______________________
tests/rpc_test.py:22: in <module>
    class MyHandler(aiozmq.rpc.AttrHandler):
tests/rpc_test.py:55: in MyHandler
    @asyncio.coroutine
E   AttributeError: module 'asyncio' has no attribute 'coroutine'

asyncio.coroutine was removed in Python 3.11 but is still used in tests/rpc_test.py

@JelleZijlstra
Copy link
Collaborator

Weirdly these tests pass in CI, I wonder how that is working.

@beenje
Copy link
Author

beenje commented Nov 5, 2022

Looking at the CI logs:

running check
[28](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:29)
Skipping 'rpc_test': module 'asyncio' has no attribute 'coroutine'
[29](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:30)
Traceback (most recent call last):
[30](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:31)
  File "/home/runner/work/aiozmq/aiozmq/runtests.py", line 145, in load_modules
[31](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:32)
    mods.append((loader.load_module(), sourcefile))
[32](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:33)
                 ^^^^^^^^^^^^^^^^^^^^
[33](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:34)
  File "<frozen importlib._bootstrap_external>", line 605, in _check_name_wrapper
[34](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:35)
  File "<frozen importlib._bootstrap_external>", line 1120, in load_module
[35](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:36)
  File "<frozen importlib._bootstrap_external>", line 945, in load_module
[36](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:37)
  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
[37](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:38)
  File "<frozen importlib._bootstrap>", line 721, in _load
[38](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:39)
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[39](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:40)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[40](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:41)
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[41](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:42)
  File "tests/rpc_test.py", line 22, in <module>
[42](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:43)
    class MyHandler(aiozmq.rpc.AttrHandler):
[43](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:44)
  File "tests/rpc_test.py", line 55, in MyHandler
[44](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:45)
    @asyncio.coroutine
[45](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:46)
     ^^^^^^^^^^^^^^^^^
[46](https://github.com/aio-libs/aiozmq/actions/runs/3382392260/jobs/5617269355#step:6:47)
AttributeError: module 'asyncio' has no attribute 'coroutine'

Not sure why this isn't reported as an error.
I see that python setup.py check is used. Invoking setup.py directly is deprecated: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html

I'd recommend to just run pytest.

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

2 participants