Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[REFACTOR] Split test classes into two:TestXXXNoRequest &TestXXXRequest #3407

Closed
Assignees
harshil21
Labels
⚙️ testsaffected functionality: tests🛠 refactorchange type: refactor
@harshil21

Description

@harshil21

Currently each of our test files has about one TestClass, which tests everything about the class together. This is not optimal because:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

Labels

⚙️ testsaffected functionality: tests🛠 refactorchange type: refactor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp