Skip to content

[Bug]: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited #229

Closed

Description

@mohankumarelec

What happened?

pytest throws warning /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/unittest/mock.py:2135: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Relevant log output

tests/server/tasks/test_result_aggregator.py::TestResultAggregator::test_consume_and_break_on_auth_required_task_event
  /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/unittest/mock.py:2135: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
  Coroutine created at (most recent call last)
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
      self.run_forever()
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
      self._run_once()
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/asyncio/base_events.py", line 1901, in _run_once
      handle._run()
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/asyncio/events.py", line 80, in _run
      self._context.run(self._callback, *self._args)
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/unittest/async_case.py", line [101](https://github.com/a2aproject/a2a-python/actions/runs/15824691005/job/44601789210#step:7:102), in _asyncioLoopRunner
      ret = await awaitable
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/unittest/mock.py", line 1396, in patched
      return await func(*newargs, **newkeywargs)
    File "/home/runner/work/a2a-python/a2a-python/tests/server/tasks/test_result_aggregator.py", line 310, in test_consume_and_break_on_auth_required_status_update_event
      ) = await self.aggregator.consume_and_break_on_interrupt(
    File "/home/runner/work/a2a-python/a2a-python/src/a2a/server/tasks/result_aggregator.py", line 134, in consume_and_break_on_interrupt
      asyncio.create_task(self._continue_consuming(event_stream))  # noqa: RUF006
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/unittest/mock.py", line [111](https://github.com/a2aproject/a2a-python/actions/runs/15824691005/job/44601789210#step:7:112)4, in __call__
      return self._mock_call(*args, **kwargs)
    File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/unittest/mock.py", line 1118, in _mock_call
      return self._execute_mock_call(*args, **kwargs)
    setattr(_type, entry, MagicProxy(entry, self))
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added 2 commits that reference this issue on Jun 23, 2025
    2d851ad
    870315f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions