diff --git a/src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py b/src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py index 01ae5006207..900c33dd6fd 100644 --- a/src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py +++ b/src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py @@ -5,6 +5,7 @@ from tribler_common.sentry_reporter import sentry_reporter from tribler_common.sentry_reporter.sentry_reporter import SentryReporter + from tribler_core.components.reporter.exception_handler import CoreExceptionHandler pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/tests/test_start_core.py b/src/tribler-core/tribler_core/tests/test_start_core.py index 50221aadd16..035bafc7b19 100644 --- a/src/tribler-core/tribler_core/tests/test_start_core.py +++ b/src/tribler-core/tribler_core/tests/test_start_core.py @@ -2,7 +2,6 @@ import pytest -from tribler_core.components.reporter.exception_handler import CoreExceptionHandler from tribler_core.settings import ErrorHandlingSettings from tribler_core.start_core import start_tribler_core @@ -24,11 +23,12 @@ class MockedProcessChecker(MagicMock): @patch('tribler_core.start_core.ProcessChecker', new=MockedProcessChecker()) @patch('asyncio.get_event_loop', new=MagicMock()) @patch('tribler_core.start_core.TriblerConfig.load') -async def test_start_tribler_core_requires_user_consent(mocked_config): +@patch('tribler_core.start_core.default_core_exception_handler') +async def test_start_tribler_core_requires_user_consent(mocked_core_exception_handler, mocked_config): # test that CoreExceptionHandler sets `requires_user_consent` in regarding the Tribler's config class MockedTriblerConfig(MagicMock): error_handling = ErrorHandlingSettings(core_error_reporting_requires_user_consent=False) mocked_config.return_value = MockedTriblerConfig() start_tribler_core('.', 1, 'key', '.', False) - assert not CoreExceptionHandler.requires_user_consent + assert mocked_core_exception_handler.requires_user_consent == False