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

test_simple_dispatch fails on Python 3.12 #2365

Open
mweinelt opened this issue Mar 2, 2024 · 0 comments
Open

test_simple_dispatch fails on Python 3.12 #2365

mweinelt opened this issue Mar 2, 2024 · 0 comments
Labels

Comments

@mweinelt
Copy link

mweinelt commented Mar 2, 2024

Describe the bug

Running the test suite on Python 3.12 fails the test_simple_dispatch test.

Error log

_____________________________ test_simple_dispatch _____________________________

    async def test_simple_dispatch():
        dispatched_msg1 = None
        dispatched_msg2 = None
    
        async def dispatch_func1(message: bytes) -> None:
            nonlocal dispatched_msg1
            dispatched_msg1 = message
    
        def dispatch_func2(message: bytes) -> None:
            nonlocal dispatched_msg2
            dispatched_msg2 = message
    
        dispatcher = MessageDispatcher[int, bytes]()
        dispatcher.listen_to(1, dispatch_func1)
        dispatcher.listen_to(2, dispatch_func2)
    
        await asyncio.wait_for(asyncio.gather(*dispatcher.dispatch(1, b"123")), 5.0)
        assert dispatched_msg1 == b"123"
        assert dispatched_msg2 is None
    
        dispatched_msg1 = None
    
        await asyncio.wait_for(asyncio.gather(*dispatcher.dispatch(2, b"456")), 5.0)
        assert dispatched_msg1 is None
>       assert dispatched_msg2 == b"456"
E       AssertionError: assert None == b'456'

tests/core/test_protocol.py:163: AssertionError

How to reproduce the bug?

Run the testsuite von Python 3.12.

What is expected behavior?

It should pass, same as on Python 3.11.

Operating System

Linux

Python

Other

pyatv

0.14.5

Device

n/a

Additional context

n/a

@mweinelt mweinelt added the bug label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant