Skip to content

Conversation

alexander-alderman-webb
Copy link
Contributor

Copy link

codecov bot commented Sep 3, 2025

❌ 1335 Tests Failed:

Tests completed Failed Passed Skipped
3286 1335 1951 954
View the top 3 failed test(s) by shortest run time
::tests.test_basics
Stack Traces | 0s run time
ImportError while importing test module '.../sentry-python/tests/test_basics.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.tox/py3.13-common-v1.36.0/lib/python3.13.../site-packages/_pytest/python.py:498: in importtestmodule
    mod = import_path(
.tox/py3.13-common-v1.36.0/lib/python3.13.../site-packages/_pytest/pathlib.py:587: in import_path
    importlib.import_module(module_name)
.../hostedtoolcache/Python/3.13.7....../x64/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.tox/py3.13-common-v1.36.0/lib/python3.13.../_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
tests/test_basics.py:496: in <module>
    importlib.import_module(integration.rsplit(".", 1)[0]),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.../hostedtoolcache/Python/3.13.7....../x64/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1324: in _find_and_load_unlocked
    ???
E   ModuleNotFoundError: No module named 'sentry_sdk.integrations.unraisablehook'
tests.integrations.httpx.test_httpx::test_crumb_capture_client_error[405-warning-httpx_client0]
Stack Traces | 0s run time
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/__init__.py:67: in httpx_mock
    mock._assert_options()
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/_httpx_mock.py:319: in _assert_options
    assert not callbacks_not_executed, (
E   AssertionError: The following responses are mocked but not requested:
E     - Match any request
E     
E     If this is on purpose, refer to https://github..../blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E   assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7f9f1d3d5130>]
tests.integrations.httpx.test_httpx::test_propagates_twp_outside_root_span
Stack Traces | 0s run time
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/__init__.py:67: in httpx_mock
    mock._assert_options()
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/_httpx_mock.py:319: in _assert_options
    assert not callbacks_not_executed, (
E   AssertionError: The following responses are mocked but not requested:
E     - Match any request
E     
E     If this is on purpose, refer to https://github..../blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E   assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7f9f1d7f35e0>]

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@alexander-alderman-webb alexander-alderman-webb marked this pull request as draft September 3, 2025 13:19
Comment on lines +79 to +81
_DEFAULT_INTEGRATIONS.append(
"sentry_sdk.integrations.unraisablehook.UnraisablehookIntegration"
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: Adding a non-existent integration causes an unhandled `ModuleNotFoundError` in `iter_default_integrations`, crashing applications during `sentry_sdk.init()`.
  • Description: The iter_default_integrations function attempts to import sentry_sdk.integrations.unraisablehook.UnraisablehookIntegration, which does not exist in the codebase. This action triggers a ModuleNotFoundError. The try...except block within the function is not configured to catch this specific exception, as it only handles DidNotEnable and SyntaxError. As a result, the unhandled ModuleNotFoundError will propagate up the call stack during SDK initialization (sentry_sdk.init()), causing any application using the SDK with default settings to crash on startup.

  • Suggested fix: Add ModuleNotFoundError to the except clause in the iter_default_integrations function. This will ensure that attempting to load a non-existent integration is gracefully handled by logging a debug message and continuing, which matches the intended behavior for other integration loading failures.
    severity: 0.9, confidence: 0.98

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant