Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
P403n1x87 committed Jan 23, 2025
1 parent 57b22b6 commit a5e55a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/internal/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,20 @@ def test_non_deprecated_python_version():
check_supported_python_version()
# Verify some things
assert len(w) == 0


def test_module_watchdog_no_interal_frames_in_import_exceptions(module_watchdog):
try:
import tests.submod.import_test # noqa:F401
except ImportError as e:
import ddtrace.internal.module as m

sources = set()

tb = e.__traceback__
while tb is not None:
sources.add(Path(tb.tb_frame.f_code.co_filename).resolve())
tb = tb.tb_next

m_origin = origin(m)
assert m_origin is not None and m_origin not in sources
1 change: 1 addition & 0 deletions tests/submod/import_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ddtrace import doesnotexist # noqa

0 comments on commit a5e55a7

Please sign in to comment.