aiortc / aioice

asyncio-based Interactive Connectivity Establishment (RFC 5245)
BSD 3-Clause "New" or "Revised" License
105 stars 51 forks source link

tests.test_stun.MessageTest fails with python 3.11 #67

Closed jonassmedegaard closed 1 year ago

jonassmedegaard commented 1 year ago

Debian-packaged aioice worked fine with python 3.10 but began to fail with python 3.11:

=================================== FAILURES ===================================
_______________________ MessageTest.test_binding_request _______________________

self = <tests.test_stun.MessageTest testMethod=test_binding_request>

    def test_binding_request(self):
        data = read_message("binding_request.bin")

        message = stun.parse_message(data)
        self.assertEqual(message.message_method, stun.Method.BINDING)
        self.assertEqual(message.message_class, stun.Class.REQUEST)
        self.assertEqual(message.transaction_id, b"Nvfx3lU7FUBF")
        self.assertEqual(message.attributes, OrderedDict())

        self.assertEqual(bytes(message), data)
>       self.assertEqual(
            repr(message),
            "Message(message_method=Method.BINDING, message_class=Class.REQUEST, "
            "transaction_id=b'Nvfx3lU7FUBF')",
        )
E       AssertionError: "Mess[14 chars]thod=1, message_class=0, transaction_id=b'Nvfx3lU7FUBF')" != "Mess[14 chars]thod=Method.BINDING, message_class=Class.REQUE[31 chars]BF')"
E       - Message(message_method=1, message_class=0, transaction_id=b'Nvfx3lU7FUBF')
E       ?                        ^                ^
E       + Message(message_method=Method.BINDING, message_class=Class.REQUEST, transaction_id=b'Nvfx3lU7FUBF')
E       ?                        ^^^^^^^^^^^^^^                ^^^^^^^^^^^^^

tests/test_stun.py:101: AssertionError
jlaine commented 1 year ago

Which version of aioice is this? This should have been fixed by 9a63c1117a6708f8cecca43d874330b51d34937b which was released in version 0.8.0.

jonassmedegaard commented 1 year ago

Sorry for failing to include release version. Comparing the date of this report, of [Debian packaging releases(https://tracker.debian.org/pkg/python-aioice) and of your release tags, it seems this report was tied to release 0.7.7.

I can confirm (and again: sorry for not consequently closing this report on my own) that the issue is not reproducible with a newer packaging release based on 0.8.0.