Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test_official to be more modular #3874

Closed
Bibo-Joshi opened this issue Sep 4, 2023 · 3 comments · Fixed by #4087
Closed

Refactor test_official to be more modular #3874

Bibo-Joshi opened this issue Sep 4, 2023 · 3 comments · Fixed by #4087

Comments

@Bibo-Joshi
Copy link
Member

test_offcial has evolved greatly over time with #3868 introducing yet more extensive testing.
To keep order in there, we should try to get it a bit more moduler. Ideas:

  • move helper functions to a different module
  • move configurations about PTB exceptions to a different module
  • make checking of existence, optional arguments, type hints different module
  • Maybe class-based approaches (e.g. wrapping python objects and corresponding documentation into one container) may make sense
@Jiang15
Copy link

Jiang15 commented Oct 2, 2023

@Bibo-Joshi Hi, I would like to work on this. Could you assign it to me?

@Bibo-Joshi
Copy link
Member Author

Hi. In general, contributions are ofc very much welcome!
This particular issue is however not well suited for first-time contributors as it targets a specifically involved part of the unit tests. If you want to PR this issue, I would ask you to first provide a draft of the changes that you would like to make. I imagine that this would include a scetch of a proposed file structure along with descriptions of which functionality should go where as well as descriptions of which helper functions you want to extract and which classes you want to introduce and how they interacet with eachother.
I'm asking you this to ensure that the the PR-&-Review-Process doesn't get too painful for either side :)

@harshil21 harshil21 self-assigned this Jan 24, 2024
@harshil21
Copy link
Member

harshil21 commented Jan 24, 2024

will tackle this over the weekend/coming days. Specially since test_official has become even more complicated with the release of API 7.0. I'll consider having test_official in a separate folder itself since even the auxil folder is cluttering up imo.

Another idea:

  • caching of fetched classes from the bot api website, which will help in speeding up local testing.
  • logging? Would also speed up local testing, as I won't have to insert print statements all the time.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants