Skip to content

TestDogStatsd.test_timed_coroutine fails on Python 3.13 #880

@mweinelt

Description

@mweinelt

Describe the bug
On Python 3.13 the test TestDogStatsd.test_timed_coroutine started failing.

Please start testing on anything newer than the EOL 3.7!

To Reproduce
Steps to reproduce the behavior:

  1. Run the testsuite on Python 3.13

Expected behavior
Tests should probably work on stable Python version.

Screenshots

______________________ TestDogStatsd.test_timed_coroutine ______________________

self = <tests.unit.dogstatsd.test_statsd.TestDogStatsd testMethod=test_timed_coroutine>

        @unittest.skipIf(not is_higher_py35(), reason="Coroutines are supported on Python 3.5 or higher.")
        def test_timed_coroutine(self):
            """
            Measure the distribution of a coroutine function's run time.
    
            Warning: Python > 3.5 only.
            """
            import asyncio
    
            source = """
    @self.statsd.timed('timed.test')
    async def print_foo():
        "docstring"
        import time
        time.sleep(0.5)
        print("foo")
            """
            exec(source, {}, locals())
    
            loop = asyncio.get_event_loop()
>           loop.run_until_complete(locals()['print_foo']())
E           KeyError: 'print_foo'

tests/unit/dogstatsd/test_statsd.py:940: KeyError

Environment and Versions (please complete the following information):
Python 3.13.1
datadog 0.50.2

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug related issuestaleStale - Bot reminder

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions