NicolasLM / spinach

Modern Redis task queue for Python 3
https://spinach.readthedocs.io
BSD 2-Clause "Simplified" License
63 stars 4 forks source link

Tests fail on Python 3.10 #17

Closed juledwar closed 2 years ago

juledwar commented 2 years ago

I just run tox on a system with python 3.10:


broker = <MemoryBroker: 729764a3-16c9-493f-baf4-feb394d43fa5>

    def test_periodic_tasks(broker):
        tasks = [
            Task(print, 'foo', 'q1', 0, timedelta(seconds=5)),
            Task(print, 'bar', 'q1', 0, timedelta(seconds=10))
        ]
        broker.register_periodic_tasks(tasks)

>       r = broker.inspect_periodic_tasks()

tests/test_brokers.py:136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
spinach/brokers/memory.py:129: in inspect_periodic_tasks
    return [(int(e[0]), e[3][0].name) for e in self._scheduler.queue]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

.0 = <list_iterator object at 0x7f3797d9b3d0>

>   return [(int(e[0]), e[3][0].name) for e in self._scheduler.queue]
E   TypeError: 'method' object is not subscriptable

spinach/brokers/memory.py:129: TypeError