Python 3.11. Async test runner
Asked Answered
C

0

8

Decided to upgrade Python version from 3.10 to 3.11, previously we have used asynctest.TestCase which has setUp and tearDown methods and supports testing of async code.

I've checked unittest.IsolatedAsyncioTestCase but it uses different event loops for each test that causes usage of different sessions that we can't afford right now.

We are using async setUp / asyncSetUp to initialise dependencies and create test data so this feature is required.

Is there any analogs? Or what you're using for testing complex systems with python 3.11 / 3.12?

p.s asynctest.TestCase is not supported in 3.11+

I want to know is there any expertise in testing async code with python 3.11/3.12. Maybe some one also faced with my problem.

Corkhill answered 11/12, 2023 at 20:46 Comment(2)
Have you tried pytest-asyncio? pypi.org/project/pytest-asyncioOcta
We have thousands of tests written using unittest and using classes described in description. pytest with it's plugins is not aplicable. yes.Corkhill

© 2022 - 2024 — McMap. All rights reserved.