Bibo-Joshi · GitHub

@Bibo-Joshi

Copy link Copy Markdown

Member

Closes #3414. I double checked that tests do fail if any of the defaults-handling logic in tg.Bot is removed.

  • Finds a solution to not having to call get_me after each assertion or even after checking get_me via mocking it.
  • Introduces a new directory tests/auxil with a file bot_methods_checks.py in it where I moved the respective functions from conftest.py to. If this finds approval, I would move all other non-fixture things from conf.py into separate files within tests/auxil.

@Bibo-Joshi

harshil21

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm definitely for splitting up non-fixture things from conftest to this new directory. In fact, can you also extract the nested functions inside check_defaults_handling into new functions (maybe in the same file)? Would make the code in there more readable at least

@Bibo-Joshi

Copy link Copy Markdown

Member Author

In fact, can you also extract the nested functions inside check_defaults_handling into new functions (maybe in the same file)? Would make the code in there more readable at least

Those functions are nested because they work with several of the variables defined within check_defaults_handling/check_shortcut_call. Extracting those methods would mean that I'd have to add several more arguments to them & set them with functools.partial. I don't see a compelling benefit of that tbh …

@harshil21

Copy link Copy Markdown

Member

harshil21

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I can verify if this works only after this is merged to master, but the tests passing here are a good indication it will.

@Bibo-Joshi

@Bibo-Joshi

Closed

1 task

Read the original on github.com ↗