supervisor/tests/utils/test_sentry.py
Stefan Agner a2b8df0a6a
Use Sentry helper function to report warnings (#5734)
* Use Sentry helper function to report warnings

Don't use Sentry directly but the existing helper function.

* Add pytest that Sentry is by default off

* Address ruff

* Address ruff
2025-03-06 23:45:48 +01:00

16 lines
419 B
Python

"""Unit tests for Sentry."""
from unittest.mock import patch
from supervisor.bootstrap import initialize_coresys
async def test_sentry_disabled_by_default(supervisor_name):
"""Test diagnostics off by default."""
with (
patch("supervisor.bootstrap.initialize_system"),
patch("sentry_sdk.init") as sentry_init,
):
await initialize_coresys()
sentry_init.assert_not_called()