This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients asvetlov, xtreak
Date 2019-05-22.18:36:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558550203.52.0.156964910774.issue37015@roundup.psfhosted.org>
In-reply-to
Content
Not sure if it helps. Set backlog in the below test as 1. Add a print statement print(type(_mock_call)) at [0] . I could see some of _mock_call to be AsyncMock . So instead of calling return _mock_self._mock_call(*args, **kwargs) directly if I call them only with they are not instance of AsyncMock (not isinstance(_mock_self, AsyncMock)) then the warning goes away. 

Guess somewhere an AsyncMock is created as I can see _accept_connection2. When the backlog value is set to 100 it shows lot of warnings.

$ ./python.exe -Werror -X tracemalloc -m unittest -vv test.test_asyncio.test_selector_events.BaseSelectorEventLoopTests.test_accept_connection_multiple


test_accept_connection_multiple (test.test_asyncio.test_selector_events.BaseSelectorEventLoopTests) ... <AsyncMock name='_accept_connection2' id='4465398880'>
<class 'unittest.mock.Mock'>
<class 'unittest.mock.Mock'>
<class 'unittest.mock.AsyncMock'>
<class 'unittest.mock.MagicMock'>
<class 'unittest.mock.Mock'>
ok

----------------------------------------------------------------------
Ran 1 test in 0.123s

OK
Exception ignored in: <coroutine object AsyncMockMixin._mock_call at 0x10a2a0e60>
Traceback (most recent call last):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/warnings.py", line 510, in _warn_unawaited_coroutine
    warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)
RuntimeWarning: coroutine 'AsyncMockMixin._mock_call' was never awaited

[0] https://github.com/python/cpython/blob/b121f63155d8e3c7c42ab6122e36eaf7f5e9f7f5/Lib/unittest/mock.py#L991
History
Date User Action Args
2019-05-22 18:36:43xtreaksetrecipients: + xtreak, asvetlov
2019-05-22 18:36:43xtreaksetmessageid: <1558550203.52.0.156964910774.issue37015@roundup.psfhosted.org>
2019-05-22 18:36:43xtreaklinkissue37015 messages
2019-05-22 18:36:43xtreakcreate