Closed as not planned
Closed as not planned
Description
Feature or enhancement
Get rid of ad-hoc implementation of async tests by using all relatively new features of standard IsolatedAsyncIoTestCase
. For this we need to:
- replace all occurences of
class ...(test_utils.TestCase):
withclass ...(unittest.IsolatedAsynIoTestCase):
- remove manually created event loops in favor of the builtin one of
IsolatedAsyncIoTestCase
- make loop-dependend test cases
async
- replace multithreading with
asyncio
wherever possible - remove unused imports
- remove the
TestCase
and classes it uses (588 -> 346 lines in test_asyncio/utils.py)
Pitch
test_asyncio.utils.TestCase
provides no extra functionality overIsolatedAsyncioTestCase
. Instead, it takes 200+ lines of code together with two more classes used nowhere else (TestSelector
andTestLoop
)TestCase
requires manual scheduling of tasks usingloop.run_until_complete
whileIsolatedAsyncioTestCase
allowsawait
TestCase
was introduced on 2014 by c73701d whileIsolatedAsynIoTestCase
was introduced 5 years later by 4dd3e3f
Progress tracking
- find and fix a bug described in gh-97983: Revert "Lay the foundation for further work in asyncio.test_streams: port server cases to IsolatedAsyncioTestCase" #98015 (comment)
- test/test_asyncgen.py
- test/test_coroutines.py
- test/test_pdb.py
- test/test_asyncio/test_base_events.py
- test/test_asyncio/test_events.py
- test/test_asyncio/test_futures.py
- test/test_asyncio/test_pep492.py
- test/test_asyncio/test_proactor_events.py
- test/test_asyncio/test_sendfile.py
- test/test_asyncio/test_sock_lowlevel.py
- test/test_asyncio/test_ssl.py
- test/test_asyncio/test_sslproto.py
- test/test_asyncio/test_streams.py
- gh-93357: Lay the foundation for further work in
asyncio.test_streams
: port server cases to IsolatedAsyncioTestCase #93369 - gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 #97896
- gh-97983: Revert "Lay the foundation for further work in asyncio.test_streams: port server cases to IsolatedAsyncioTestCase" #98015
- gh-93357: Lay the foundation for further work in
- test/test_asyncio/test_subprocess.py
- test/test_asyncio/test_tasks.py
- test/test_asyncio/test_unix_events.py
- test/test_asyncio/test_windows_events.py
- replace multithreading with asyncio wherever possible
- remove the
TestCase
- move
asyncio.set_event_loop_policy(None)
(a measure agains "test altered the execution environment" warning) intoIsolatedAsyncioTestCase
's shutdown method
There are 83 cases that use test_asyncio.utils.TestCase
test/test_asyncio/test_base_events.py:class BaseEventTests(test_utils.TestCase):
test/test_asyncio/test_base_events.py:class BaseEventLoopTests(test_utils.TestCase):
test/test_asyncio/test_base_events.py:class BaseEventLoopWithSelectorTests(test_utils.TestCase):
test/test_asyncio/test_base_events.py:class BaseLoopSockSendfileTests(test_utils.TestCase):
test/test_asyncio/test_base_events.py:class TestSelectorUtils(test_utils.TestCase):
test/test_asyncio/test_events.py: test_utils.TestCase):
test/test_asyncio/test_events.py: test_utils.TestCase):
test/test_asyncio/test_events.py: test_utils.TestCase):
test/test_asyncio/test_events.py: test_utils.TestCase):
test/test_asyncio/test_events.py: test_utils.TestCase):
test/test_asyncio/test_events.py: test_utils.TestCase):
test/test_asyncio/test_events.py:class HandleTests(test_utils.TestCase):
test/test_asyncio/test_futures.py:class DuckTests(test_utils.TestCase):
test/test_asyncio/test_futures.py:class CFutureTests(BaseFutureTests, test_utils.TestCase):
test/test_asyncio/test_futures.py:class CSubFutureTests(BaseFutureTests, test_utils.TestCase):
test/test_asyncio/test_futures.py:class PyFutureTests(BaseFutureTests, test_utils.TestCase):
test/test_asyncio/test_futures.py: test_utils.TestCase):
test/test_asyncio/test_futures.py: test_utils.TestCase):
test/test_asyncio/test_futures.py: test_utils.TestCase):
test/test_asyncio/test_futures.py: test_utils.TestCase):
test/test_asyncio/test_futures.py: test_utils.TestCase):
test/test_asyncio/test_pep492.py:class BaseTest(test_utils.TestCase):
test/test_asyncio/test_proactor_events.py:class ProactorSocketTransportTests(test_utils.TestCase):
test/test_asyncio/test_proactor_events.py:class ProactorDatagramTransportTests(test_utils.TestCase):
test/test_asyncio/test_proactor_events.py:class BaseProactorEventLoopTests(test_utils.TestCase):
test/test_asyncio/test_proactor_events.py:class ProactorEventLoopUnixSockSendfileTests(test_utils.TestCase):
test/test_asyncio/test_selector_events.py:class BaseSelectorEventLoopTests(test_utils.TestCase):
test/test_asyncio/test_selector_events.py:class SelectorTransportTests(test_utils.TestCase):
test/test_asyncio/test_selector_events.py:class SelectorSocketTransportTests(test_utils.TestCase):
test/test_asyncio/test_selector_events.py:class SelectorSocketTransportBufferedProtocolTests(test_utils.TestCase):
test/test_asyncio/test_selector_events.py:class SelectorDatagramTransportTests(test_utils.TestCase):
test/test_asyncio/test_sendfile.py: test_utils.TestCase):
test/test_asyncio/test_sendfile.py: test_utils.TestCase):
test/test_asyncio/test_sendfile.py: test_utils.TestCase):
test/test_asyncio/test_sendfile.py: test_utils.TestCase):
test/test_asyncio/test_sendfile.py: test_utils.TestCase):
test/test_asyncio/test_sendfile.py: test_utils.TestCase):
test/test_asyncio/test_sock_lowlevel.py: test_utils.TestCase):
test/test_asyncio/test_sock_lowlevel.py: test_utils.TestCase):
test/test_asyncio/test_sock_lowlevel.py: test_utils.TestCase):
test/test_asyncio/test_sock_lowlevel.py: test_utils.TestCase):
test/test_asyncio/test_sock_lowlevel.py: test_utils.TestCase):
test/test_asyncio/test_sock_lowlevel.py: test_utils.TestCase):
test/test_asyncio/test_ssl.py:class TestSSL(test_utils.TestCase):
test/test_asyncio/test_sslproto.py:class SslProtoHandshakeTests(test_utils.TestCase):
test/test_asyncio/test_streams.py:class StreamTests(test_utils.TestCase):
test/test_asyncio/test_subprocess.py:class SubprocessTransportTests(test_utils.TestCase):
test/test_asyncio/test_subprocess.py: test_utils.TestCase):
test/test_asyncio/test_subprocess.py: test_utils.TestCase):
test/test_asyncio/test_subprocess.py: test_utils.TestCase):
test/test_asyncio/test_subprocess.py: test_utils.TestCase):
test/test_asyncio/test_subprocess.py: test_utils.TestCase):
test/test_asyncio/test_subprocess.py: class SubprocessProactorTests(SubprocessMixin, test_utils.TestCase):
test/test_asyncio/test_tasks.py: test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CTask_CFuture_SubclassTests(BaseTaskTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CTaskSubclass_PyFuture_Tests(BaseTaskTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class PyTask_CFutureSubclass_Tests(BaseTaskTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CTask_PyFuture_Tests(BaseTaskTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class PyTask_CFuture_Tests(BaseTaskTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py: test_utils.TestCase):
test/test_asyncio/test_tasks.py:class PyTask_PyFuture_SubclassTests(BaseTaskTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CTask_Future_Tests(test_utils.TestCase):
test/test_asyncio/test_tasks.py:class PyIntrospectionTests(test_utils.TestCase, BaseTaskIntrospectionTests):
test/test_asyncio/test_tasks.py:class CIntrospectionTests(test_utils.TestCase, BaseTaskIntrospectionTests):
test/test_asyncio/test_tasks.py:class PyCurrentLoopTests(BaseCurrentLoopTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CCurrentLoopTests(BaseCurrentLoopTests, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class GenericTaskTests(test_utils.TestCase):
test/test_asyncio/test_tasks.py:class FutureGatherTests(GatherTestsBase, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase):
test/test_asyncio/test_tasks.py:class RunCoroutineThreadsafeTests(test_utils.TestCase):
test/test_asyncio/test_tasks.py:class SleepTests(test_utils.TestCase):
test/test_asyncio/test_tasks.py:class CompatibilityTests(test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class SelectorEventLoopSignalTests(test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class SelectorEventLoopUnixSockSendfileTests(test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class UnixReadPipeTransportTests(test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class UnixWritePipeTransportTests(test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class SafeChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
test/test_asyncio/test_unix_events.py:class FastChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
test/test_asyncio/test_windows_events.py:class ProactorLoopCtrlC(test_utils.TestCase):
test/test_asyncio/test_windows_events.py:class ProactorMultithreading(test_utils.TestCase):
test/test_asyncio/test_windows_events.py:class ProactorTests(test_utils.TestCase):
test/test_asyncio/test_windows_events.py:class WinPolicyTests(test_utils.TestCase):
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Done
Status
Done