[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread bluecarrot
bluecarrot added the comment: You are absolutely correct. Thank you very much! -- ___ Python tracker <https://bugs.python.org/issue46568> ___ ___ Python-bug

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread bluecarrot
bluecarrot added the comment: Hi Andrew, thank you for your answer. I am experimenting with coroutines, as I am pretty new to them. My idea was to let the writer drain while other packets where read, and thus I am waiting for the writer_drain right before starting writer.write again. Isn't

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread bluecarrot
bluecarrot added the comment: Seems that, should I add an "await asyncio.sleep(1)" in asyncTearDown, so getting class TestConnections(IsolatedAsyncioTestCase): async def asyncSetUp(self) -> None: self.proxy = asyncio.create_task(EnergyAgentProxy(self.proxy_port, sel

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread bluecarrot
New submission from bluecarrot : I am unittesting a tcp proxy module using coroutines. This is the coroutine I am using to do the forwarding, allowing the writer stream to drain while the rest of the coroutines are proceeding: async def forward_stream(reader: StreamReader, writer