[issue37015] Fix asyncio mock warnings

2019-05-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37015] Fix asyncio mock warnings

2019-05-30 Thread miss-islington
miss-islington added the comment: New changeset 0f39c2b1919727904f4fac2d79cb41dc6bfe41fe by Miss Islington (bot) (Xtreak) in branch 'master': bpo-37015: Ensure tasks created by _accept_connection2 due to AsyncMock are completed (GH-13661) https://github.com/python/cpython/commit/0f39c2b19197

[issue37015] Fix asyncio mock warnings

2019-05-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +13552 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13661 ___ Python tracker ___

[issue37015] Fix asyncio mock warnings

2019-05-24 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: @asvetlov No problem then if it can be fixed after beta. -- ___ Python tracker ___ ___

[issue37015] Fix asyncio mock warnings

2019-05-24 Thread Andrew Svetlov
Andrew Svetlov added the comment: xtreak thanks for investigation. I have no time to work on it now, sorry. Maybe the next week. Anyway, the problem can be fixed even in python beta stage if we don't do it earlier. -- ___ Python tracker

[issue37015] Fix asyncio mock warnings

2019-05-24 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This logic is present in create_autospec too at [0]. The behavior for patch seems to be documented at [1] which also needs to be updated to reflect that an AsyncMock by default is created instead of MagicMock if the target is an async function unli

[issue37015] Fix asyncio mock warnings

2019-05-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I guess cause is at [0] . When there is no new value specified and with spec being None if mock.patch is used on an async object (original = _accept_connection2). Here original is an async object then AsyncMock is returned. Changing this causes t

[issue37015] Fix asyncio mock warnings

2019-05-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: patching _accept_connection2 attribute on loop object seems to return an AsyncMock. ➜ cpython git:(master) ✗ cat ../backups/bpo37015.py import asyncio from unittest.mock import patch with patch.object(asyncio.get_event_loop(), '_accept_connection2')

[issue37015] Fix asyncio mock warnings

2019-05-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: 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

[issue37015] Fix asyncio mock warnings

2019-05-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue37015] Fix asyncio mock warnings

2019-05-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- title: Fix asyncio mock wranings -> Fix asyncio mock warnings ___ Python tracker ___ ___ Python-bugs-l