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

Spinach no longer passes tests in Python >= 3.11 #29

Closed
0xDEC0DE opened this issue Feb 28, 2024 · 0 comments
Closed

Spinach no longer passes tests in Python >= 3.11 #29

0xDEC0DE opened this issue Feb 28, 2024 · 0 comments

Comments

@0xDEC0DE
Copy link
Contributor

Steps to reproduce

  1. Set up a Python 3.11 or 3.12 runtime
  2. Fix tox.ini to use allowlist_externals instead of the obsolete whitelist_externals
  3. Run tox

Expected result

Tests pass

Actual behavior

Python 3.11

FAILED tests/test_engine.py::test_schedule_at - spinach.exc.InvalidJobSignatureError: Arguments of job not compatible with task bar_task: got an unexpected keyword...
FAILED tests/test_engine.py::test_schedule_batch - spinach.exc.InvalidJobSignatureError: Arguments of job not compatible with task bar_task: got an unexpected keyword...

Python 3.12

FAILED tests/test_brokers.py::test_wait_for_events_no_future_job[MemoryBroker] - AttributeError: 'called_once' is not a valid assertion. Use a spec for the mock if 'called_once' is meant to be an attribute.
FAILED tests/test_brokers.py::test_wait_for_events_no_future_job[RedisBroker] - AttributeError: 'called_once' is not a valid assertion. Use a spec for the mock if 'called_once' is meant to be an attribute.
FAILED tests/test_engine.py::test_schedule_at - spinach.exc.InvalidJobSignatureError: Arguments of job not compatible with task bar_task: got an unexpected keyword argument 'three'
FAILED tests/test_engine.py::test_schedule_batch - spinach.exc.InvalidJobSignatureError: Arguments of job not compatible with task bar_task: got an unexpected keyword argument 'three'
FAILED tests/test_utils.py::test_exponential_backoff - Failed: DID NOT RAISE <class 'ValueError'>

Miscellany

Tests DO pass when run against a Python 3.8 runtime

0xDEC0DE pushed a commit to 0xDEC0DE/spinach that referenced this issue Feb 28, 2024
Python 3.12 finally made good on their promise to start throwing
errors when trying to use `random` with non-ints, so make a good-faith
effort to do that.

Remove a now-useless test for passing floats that should now be
impossible to hit.

Drive-by: update `tox.ini` to use moern syntax

Partial fix for Issue NicolasLM#29
0xDEC0DE pushed a commit to 0xDEC0DE/spinach that referenced this issue Feb 28, 2024
Python 3.12 finally made good on their promise to start throwing
errors when trying to use `random` with non-ints, so make a good-faith
effort to do that in all versions.

Remove a now-useless test for passing floats that should now be
impossible to hit.

Partial fix for Issue NicolasLM#29
0xDEC0DE pushed a commit to 0xDEC0DE/spinach that referenced this issue Feb 28, 2024
Newer Python runtimes do more stringent method signature checking,
so use an actual Mock for dummy tasks rather than a "random" callable

Partial fix for Issue NicolasLM#29
0xDEC0DE pushed a commit to 0xDEC0DE/spinach that referenced this issue Feb 28, 2024
Newer Python runtimes do more stringent method signature checking,
so use an actual Mock for dummy tasks rather than a "random" callable

Partial fix for Issue NicolasLM#29
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

1 participant