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:
class StickerSpace: # namespace class
emoji = "💪🏽 "
...
@pytest.mark.no_req # for faster development cycle
class TestStickerNoRequest:
def test_de_json(...):
...
def test_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)
class TestStickerRequest:
def test_custom_emoji(...):
await bot.get_sticker_set(...)
Along with this change, I'll also try to simplify/shorten some tests, if possible.