Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set asyncio_mode=auto #6866

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Set asyncio_mode=auto #6866

merged 1 commit into from
Apr 28, 2022

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Apr 12, 2022

Fixes #6865

In this PR:

  1. asyncio_mode has been set to auto https://pypi.org/project/pytest-asyncio/
  2. All unnecessary markers have been removed
  3. Requirements for tests have been updated

The test_start_core has been fixed by adding async to the function definition (which could led to a correct setting of an event loop):

@patch('tribler.core.logger.logger.load_logger_config', new=MagicMock())
@patch('tribler.core.start_core.set_process_priority', new=MagicMock())
@patch('tribler.core.start_core.check_and_enable_code_tracing', new=MagicMock())
@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):
    # test that base logic of tribler core runs without exceptions
    run_tribler_core_session(1, 'key', Path('.'), False)
    mocked_core_session.assert_called_once()

@drew2a drew2a marked this pull request as ready for review April 12, 2022 14:54
@drew2a drew2a requested review from a team, xoriole and kozlovsky and removed request for a team and xoriole April 12, 2022 14:54
@drew2a drew2a force-pushed the fix/6865 branch 3 times, most recently from 936e5db to 08fc08d Compare April 14, 2022 09:27
@Tribler Tribler deleted a comment from codecov bot Apr 14, 2022
@drew2a drew2a force-pushed the fix/6865 branch 2 times, most recently from 0d0380d to 2b36129 Compare April 15, 2022 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Tests] RuntimeError: There is no current event loop in thread 'MainThread'
2 participants