Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Jan 10, 2025
1 parent 3ac8bc1 commit 31e091f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/contrib/asyncio/test_lazyimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def test_lazy_import():

@pytest.mark.subprocess()
def test_asyncio_not_imported_by_auto_instrumentation():
# Module unloading is not supported for asyncio, a simple workaround
# is to ensure asyncio is not imported by ddtrace.auto or ddtrace-run.
# If asyncio is imported by ddtrace.auto the asyncio event loop with fail
# to register new loops in some platforms (e.g. Ubuntuu).
import sys
import ddtrace.auto
assert "asyncio" not in sys.modules

import ddtrace.auto # noqa: F401

assert "asyncio" not in sys.modules

0 comments on commit 31e091f

Please sign in to comment.