- Notifications
You must be signed in to change notification settings - Fork5.9k
Closed
Description
Currently each of our test files has about one TestClass, which tests everything about the class together. This is not optimal because:
- Some tests in the class make actual requests to Telegram, thus slowing down development if you've made substantial changes to the class, but don't actually want to test the request part yet.
- It makes the tests slightly more readable, bearable and just a bit more organized.
Implementation
For example,test_sticker.py should now look like:
classStickerSpace:# namespace classemoji="💪🏽 " ...@pytest.mark.no_req# for faster development cycleclassTestStickerNoRequest:deftest_de_json(...): ...deftest_a_mock_request(...): ...@pytest.mark.req# don't think we need this, but let me know if you'd like this@pytest.mark.flaky(3,1)classTestStickerRequest:deftest_custom_emoji(...):awaitbot.get_sticker_set(...)
Along with this change, I'll also try to simplify/shorten some tests, if possible.