added 2 commits
October 16, 2022 15:52closes #3185 add 3 keyword-only arguments to pass caption to entire media group before that a caption for the group had to be manually added to the 1st media item in the group
"group_caption", "group_caption_parse_mode", and "group_caption_entities" are not part of API, so exclude them from check of arguments matching API
- replace "images" with "media" - check not only .caption but also .caption_entities and .parse_mode of individual media items
we should try to copy as little as possible: if none of the `group_*` parameters was passed, we don't need copying. Otherwise, we only need to copy (the list and) the first media item rather than all of them
check that the error is raised if user passes media that only have `parse_mode` or `caption_entities`
Check if the user explicitly set parse_mode for the InputMedia* object. Even if it is set to None, ValueError must be raised.
add fixture for a media group without individual captions rather than taking `media_group` fixtures and setting attributes manually this fixture can be used later when checking defaults
* make `parse_mode` default to DEFAULT_NONE in `Bot` and shortcut methods in classes * exclude `parse_mode` from check in conftest.py * add tests for handling of default values
to allow multiple calls with same media group, I need to copy not only the first item (that gets the caption) but all items because otherwise bot with Defaults will assign its default parse mode to every item, which will cause ValueError upon subsequent calls unless there are other things to be fixed, this should be the commit that closes #3185
Closed
`_bot.py` had two imports (import copy and from copy import copy) leave first import and replace `copy()` with `copy.copy()` in code