Description
Our test suite has once again degraded in performance and flakiness has been reintroduced. We can experiment / make our test suite better in different ways, some of my current ideas are listed roughly below:
- Try to make everything as concurrent as possible (Make network based tests as concurrent as possible #4271)
- Profile all tests and see what clogs up and fix that.
- solve the TODO in
test_official.exceptions
- refactor
test_sticker.py
since sticker sets can now hold static, animated, and video altogether. #4514 -
dirty-equals
sounds like it could be quite useful for us! - Think about renaming the
Test*Base
classes to just*Base
since pytest collects the classes starting withTest*
. Rename Testing Base Classes #4453 - Change CI's pytest
--dist
toworksteal
Updatepytest-xdist
Usage #4491 . - Extend that naming scheme to
telegram.ext
tests - fix the class name Rename Testing Base Classes #4453
Follow https://github.com/zupo/awesome-pytest-speedup, not all items but some are worth looking at:
- Introduce
pytest-socket
and completely disable network access for*WithoutRequest
tests (PoC:pytest-socket
like testing #4317, Make Tests fortelegram.ext
Independent of Networking #4454) -
Introduce(no major benefit found - Make network based tests as concurrent as possible #4271 (comment))pyfakefs
to test suite - Check if using
uvloop
in tests provides any measurable speed up. - Isolate tests from other tests
- Check if introducing
pytest-randomly
(need to check if pytest-xdist effectively does the job of randomly)
-> Check if using pytest-asyncio-cooperative
is worth it
- Nope it is not.