Mailing List Archive

[issue45238] Fix debug() in IsolatedAsyncioTestCase
New submission from Serhiy Storchaka <storchaka+cpython@gmail.com>:

Currently debug() does not work in IsolatedAsyncioTestCase subclasses. It runs synchronous code (setUp(), tearDown(), synchronous tests and cleanup functions), but does not run any asynchronous code (asyncSetUp(), asyncTearDown(), asynchronous tests and cleanup functions) and produces warnings "RuntimeWarning: coroutine 'xxx' was never awaited".

----------
components: Library (Lib), asyncio
messages: 402132
nosy: asvetlov, ezio.melotti, michael.foord, rbcollins, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Fix debug() in IsolatedAsyncioTestCase
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
Change by Serhiy Storchaka <storchaka+cpython@gmail.com>:


----------
keywords: +patch
pull_requests: +26852
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28449

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:

It turned out be more complicated than I expected. We need to keep the even loop after getting exception in debug() for having ability to run doCleanup() etc. The option is to close the even loop in __del__. But we should ensure that it is closed before running other event loop. Also, assertRaises() creates reference loops, so we cannot use it.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:


New changeset ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d by Serhiy Storchaka in branch 'main':
bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449)
https://github.com/python/cpython/commit/ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
Change by ?ukasz Langa <lukasz@langa.pl>:


----------
pull_requests: +26912
pull_request: https://github.com/python/cpython/pull/28521

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
Change by ?ukasz Langa <lukasz@langa.pl>:


----------
pull_requests: +26913
pull_request: https://github.com/python/cpython/pull/28522

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:


New changeset 44396aaba9b92b3a38a4b422a000d1a8eb05185a by ?ukasz Langa in branch '3.10':
[3.10] bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) (GH-28521)
https://github.com/python/cpython/commit/44396aaba9b92b3a38a4b422a000d1a8eb05185a


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:


New changeset e06b0fddf69b933fe82f60d78a0f6248ca36a0a3 by ?ukasz Langa in branch '3.9':
[3.9] bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) (GH-28522)
https://github.com/python/cpython/commit/e06b0fddf69b933fe82f60d78a0f6248ca36a0a3


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45238] Fix debug() in IsolatedAsyncioTestCase [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:

Thanks, Serhiy! ? ???? ?

----------
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45238>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com