cockpit
cockpit copied to clipboard
pytests: update fixtures to not use deprecated event_loop
trafficstars
- [x] https://github.com/cockpit-project/cockpit/pull/22135
pytest_asyncio dropped event_loop fixture in version 1.0.0
let's see what happens :)
python 3.6 does not seem to like this
@jelly so I managed to get tox green. Can't say I am confident with this. Please take a look :)
from journal
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: Traceback (most recent call last):
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: File "/usr/sbin/cockpit-bridge", line 5, in <module>
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: from cockpit.bridge import main
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: File "/usr/lib/python3.13/site-packages/cockpit/bridge.py", line 35, in <module>
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: from . import polyfills
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: File "/usr/lib/python3.13/site-packages/cockpit/polyfills.py", line 21, in <module>
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: import pytest_asyncio
Jun 04 14:34:24 fedora-42-127-0-0-2-2201 cockpit-session[2356]: ModuleNotFoundError: No module named 'pytest_asyncio'
that's me being silly and bridge definitely should not depend on pytest_asyncio
hmm so vulture still complains about _check_settled being unused
FAIL: test/common/static-code
=============================
not ok 12 /static-code/test-vulture
# test/pytest/conftest.py:83: unused function '_check_settled' (60% confidence)
FAIL test/common/static-code (exit status: 1)
but with print(...) inside of it I can tell that it runs on every test 🤔
eg:
test/pytest/test_transport.py::TestSubprocessTransport::test_write_backlog_eof_and_close
_CHECK_SETTLED_YIELD
PASSED
_CHECK_SETTLED_END