Skip to content

Commit

Permalink
Remove async
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Nov 1, 2022
1 parent 474e9af commit a7d72f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/tribler/core/tests/test_check_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

@patch('sys.exit')
@patch('tribler.core.check_os.show_system_popup')
async def test_error_and_exit(mocked_show_system_popup, mocked_sys_exit):
def test_error_and_exit(mocked_show_system_popup, mocked_sys_exit):
error_and_exit('title', 'text')
mocked_show_system_popup.assert_called_once_with('title', 'text')
mocked_sys_exit.assert_called_once_with(1)


@patch_import(['faulthandler'], strict=True, enable=MagicMock())
@patch('tribler.core.check_os.open', new=MagicMock())
async def test_enable_fault_handler():
def test_enable_fault_handler():
import faulthandler
enable_fault_handler(log_dir=MagicMock())
faulthandler.enable.assert_called_once()
Expand All @@ -27,14 +27,14 @@ async def test_enable_fault_handler():
@patch_import(['faulthandler'], strict=True, always_raise_exception_on_import=True)
@patch.object(Logger, 'error')
@patch('tribler.core.check_os.open', new=MagicMock())
async def test_enable_fault_handler_import_error(mocked_log_error: MagicMock):
def test_enable_fault_handler_import_error(mocked_log_error: MagicMock):
enable_fault_handler(log_dir=MagicMock())
mocked_log_error.assert_called_once()


@patch_import(['faulthandler'], strict=True, enable=MagicMock())
@patch('tribler.core.check_os.open', new=MagicMock())
async def test_enable_fault_handler_log_dir_not_exists():
def test_enable_fault_handler_log_dir_not_exists():
log_dir = MagicMock(exists=MagicMock(return_value=False),
mkdir=MagicMock())

Expand Down
2 changes: 1 addition & 1 deletion src/tribler/core/tests/test_start_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@patch('asyncio.get_event_loop', new=MagicMock())
@patch('tribler.core.start_core.TriblerConfig.load', new=MagicMock())
@patch('tribler.core.start_core.core_session')
async def test_start_tribler_core_no_exceptions(mocked_core_session):
def test_start_tribler_core_no_exceptions(mocked_core_session):
# test that base logic of tribler core runs without exceptions
run_tribler_core_session(1, 'key', Path('.'), False)
mocked_core_session.assert_called_once()

0 comments on commit a7d72f8

Please sign in to comment.