You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ErrorMessageRuntimeError: 1RuntimeWarning,
/usr/lib/python3.8/weakref.py:131:coroutine'AsyncMockMixin._execute_mock_call'wasneverawaitedStacktracepyfuncitem=<Functiontest_set_rate_settings>defpytest_pyfunc_call(pyfuncitem): # type: ignore""" Run coroutines in an event loop instead of a normal function call. """fast=pyfuncitem.config.getoption("--aiohttp-fast")
ifasyncio.iscoroutinefunction(pyfuncitem.function):
existing_loop=pyfuncitem.funcargs.get('proactor_loop')\
orpyfuncitem.funcargs.get('loop', None)
with_runtime_warning_context():
with_passthrough_loop_context(existing_loop, fast=fast) as_loop:
testargs= {arg: pyfuncitem.funcargs[arg]
forarginpyfuncitem._fixtureinfo.argnames}
>_loop.run_until_complete(pyfuncitem.obj(**testargs))
/usr/local/lib/python3.8/dist-packages/aiohttp/pytest_plugin.py:170:
Full error
ErrorMessageRuntimeError: 1RuntimeWarning,
/usr/lib/python3.8/weakref.py:131:coroutine'AsyncMockMixin._execute_mock_call'wasneverawaitedStacktracepyfuncitem=<Functiontest_set_rate_settings>defpytest_pyfunc_call(pyfuncitem): # type: ignore""" Run coroutines in an event loop instead of a normal function call. """fast=pyfuncitem.config.getoption("--aiohttp-fast")
ifasyncio.iscoroutinefunction(pyfuncitem.function):
existing_loop=pyfuncitem.funcargs.get('proactor_loop')\
orpyfuncitem.funcargs.get('loop', None)
with_runtime_warning_context():
with_passthrough_loop_context(existing_loop, fast=fast) as_loop:
testargs= {arg: pyfuncitem.funcargs[arg]
forarginpyfuncitem._fixtureinfo.argnames}
>_loop.run_until_complete(pyfuncitem.obj(**testargs))
/usr/local/lib/python3.8/dist-packages/aiohttp/pytest_plugin.py:170:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/contextlib.py:120: in__exit__next(self.gen)
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@contextlib.contextmanagerdef_runtime_warning_context(): # type: ignore""" Context manager which checks for RuntimeWarnings, specifically to avoid "coroutine 'X' was never awaited" warnings being missed. If RuntimeWarnings occur in the context a RuntimeError is raised. """withwarnings.catch_warnings(record=True) as_warnings:
yieldrw= ['{w.filename}:{w.lineno}:{w.message}'.format(w=w)
forwin_warnings# type: ignoreifw.category==RuntimeWarning]
ifrw:
>raiseRuntimeError('{} Runtime Warning{},\n{}'.format(
len(rw),
''iflen(rw) ==1else's',
'\n'.join(rw)
))
ERuntimeError: 1RuntimeWarning,
E/usr/lib/python3.8/weakref.py:131:coroutine'AsyncMockMixin._execute_mock_call'wasneverawaited/usr/local/lib/python3.8/dist-packages/aiohttp/pytest_plugin.py:127: RuntimeError
The text was updated successfully, but these errors were encountered:
There are only two parts of the codebase that use AsyncMock. One of them is test_get_events_has_undelivered_error.
The output is as follows:
test_events_endpoint.py::test_get_events_has_undelivered_error
============================== 1 passed in 0.30s ===============================
sys:1: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Process finished with exit code 0
PASSED [100%]
The test passes, but leaves behind AsyncMockMixin._execute_mock_call for another test (test_set_rate_settings) to fail on.
I see random test failure for PR tests on Linux
https://jenkins-ci.tribler.org/job/GH_Tribler_PR_Tests/job/PR_linux_pytest/2449/testReport/junit/src.tribler-core.tribler_core.components.restapi.rest.tests/test_settings_endpoint/test_set_rate_settings/
Full error
The text was updated successfully, but these errors were encountered: