❌ 177 Tests Failed:Tests completed | Failed | Passed | Skipped |
---|
6375 | 177 | 6198 | 452 |
View the top 3 failed tests by shortest run timetests.test_bot.TestBotWithoutRequest::test_defaults_handling[Bot.get_forum_topic_icon_stickers] Stack Traces | 0.002s run timeself=<tests.test_bot.TestBotWithoutRequestobjectat0x0000013990675270>bot_class=<class'telegram._bot.Bot'>bot_method_name='get_forum_topic_icon_stickers'bot_method=<boundmethodExtBot.get_forum_topic_icon_stickersofPytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]>offline_bot=PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]raw_bot=PytestBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]@bot_methods(ext_bot=False)asyncdeftest_defaults_handling(self,bot_class,bot_method_name:str,bot_method,offline_bot:PytestExtBot,raw_bot:PytestBot, ):""" Here we check that the offline_bot methods handle tg.ext.Defaults correctly. This has two parts: 1. Check that ExtBot actually inserts the defaults values correctly 2. Check that tg.Bot just replaces `DefaultValue(obj)` with `obj`, i.e. that it doesn't pass any `DefaultValue` instances to Request. See the docstring of tg.Bot._insert_defaults for details on why we need that As for most defaults, we can't really check the effect, we just check if we're passing the correct kwargs to Request.post. As offline_bot method tests a scattered across the different test files, we do this here in one place. The same test is also run for all the shortcuts (Message.reply_text) etc in the corresponding tests. Finally, there are some tests for Defaults.{parse_mode, quote, allow_sending_without_reply} at the appropriate places, as those are the only things we can actually check. """# Mocking get_me within check_defaults_handling messes with the cached values like# Bot.{bot, username, id, …}` unless we return the expected User object.return_value= (offline_bot.botifbot_method_name.lower().replace("_","")=="getme"elseNone )# Check that ExtBot does the right thingbot_method=getattr(offline_bot,bot_method_name)raw_bot_method=getattr(raw_bot,bot_method_name)>assertawaitcheck_defaults_handling(bot_method,offline_bot,return_value=return_value)tests\test_bot.py:500:__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _tests\auxil\bot_method_checks.py:668:incheck_defaults_handlingraiseexctests\auxil\bot_method_checks.py:636:incheck_defaults_handlingassertawaitmethod(**kwargs)inexpected_return_valuestelegram\ext\_extbot.py:1913:inget_forum_topic_icon_stickersreturnawaitsuper().get_forum_topic_icon_stickers(telegram\_bot.py:8328:inget_forum_topic_icon_stickersreturnSticker.de_list(result,self)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _cls=<class'telegram._files.sticker.Sticker'>,data=Nonebot=PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA] @classmethoddefde_list(cls:type[Tele_co],data:list[JSONDict],bot:Optional["Bot"]=None )->tuple[Tele_co, ...]:"""Converts a list of JSON objects to a tuple of Telegram objects. .. versionchanged:: 20.0 * Returns a tuple instead of a list. * Filters out any :obj:`None` values. Args: data (list[dict[:obj:`str`, ...]]): The JSON data. bot (:class:`telegram.Bot`, optional): The bot associated with these object. Defaults to :obj:`None`, in which case shortcut methods will not be available. .. versionchanged:: 21.4 :paramref:`bot` is now optional and defaults to :obj:`None` Returns: A tuple of Telegram objects. """>returntuple(objforobjin (cls.de_json(d,bot)fordindata))ETypeError:'NoneType'objectisnotiterabletelegram\_telegramobject.py:457:TypeError
tests.test_bot.TestBotWithoutRequest::test_defaults_handling[Bot.get_chat] Stack Traces | 0.003s run timeself=<tests.test_bot.TestBotWithoutRequestobjectat0x0000013990674FF0>bot_class=<class'telegram._bot.Bot'>,bot_method_name='get_chat'bot_method=<boundmethodExtBot.get_chatofPytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]>offline_bot=PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]raw_bot=PytestBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]@bot_methods(ext_bot=False)asyncdeftest_defaults_handling(self,bot_class,bot_method_name:str,bot_method,offline_bot:PytestExtBot,raw_bot:PytestBot, ):""" Here we check that the offline_bot methods handle tg.ext.Defaults correctly. This has two parts: 1. Check that ExtBot actually inserts the defaults values correctly 2. Check that tg.Bot just replaces `DefaultValue(obj)` with `obj`, i.e. that it doesn't pass any `DefaultValue` instances to Request. See the docstring of tg.Bot._insert_defaults for details on why we need that As for most defaults, we can't really check the effect, we just check if we're passing the correct kwargs to Request.post. As offline_bot method tests a scattered across the different test files, we do this here in one place. The same test is also run for all the shortcuts (Message.reply_text) etc in the corresponding tests. Finally, there are some tests for Defaults.{parse_mode, quote, allow_sending_without_reply} at the appropriate places, as those are the only things we can actually check. """# Mocking get_me within check_defaults_handling messes with the cached values like# Bot.{bot, username, id, …}` unless we return the expected User object.return_value= (offline_bot.botifbot_method_name.lower().replace("_","")=="getme"elseNone )# Check that ExtBot does the right thingbot_method=getattr(offline_bot,bot_method_name)raw_bot_method=getattr(raw_bot,bot_method_name)>assertawaitcheck_defaults_handling(bot_method,offline_bot,return_value=return_value)tests\test_bot.py:500:__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _tests\auxil\bot_method_checks.py:668:incheck_defaults_handlingraiseexctests\auxil\bot_method_checks.py:636:incheck_defaults_handlingassertawaitmethod(**kwargs)inexpected_return_valuestelegram\ext\_extbot.py:889:inget_chatresult=awaitsuper().get_chat(telegram\_bot.py:4732:inget_chatreturnChatFullInfo.de_json(result,self)telegram\_chatfullinfo.py:517:inde_jsondata=cls._parse_data(data)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _data=None @staticmethoddef_parse_data(data:JSONDict)->JSONDict:"""Should be called by subclasses that override de_json to ensure that the input is not altered. Whoever calls de_json might still want to use the original input for something else. """>returndata.copy()EAttributeError:'NoneType'objecthasnoattribute'copy'telegram\_telegramobject.py:385:AttributeError
tests.test_bot.TestBotWithoutRequest::test_defaults_handling[Bot.get_star_transactions] Stack Traces | 0.003s run timeself=<tests.test_bot.TestBotWithoutRequestobjectat0x0000013990675590>bot_class=<class'telegram._bot.Bot'>bot_method_name='get_star_transactions'bot_method=<boundmethodExtBot.get_star_transactionsofPytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]>offline_bot=PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]raw_bot=PytestBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]@bot_methods(ext_bot=False)asyncdeftest_defaults_handling(self,bot_class,bot_method_name:str,bot_method,offline_bot:PytestExtBot,raw_bot:PytestBot, ):""" Here we check that the offline_bot methods handle tg.ext.Defaults correctly. This has two parts: 1. Check that ExtBot actually inserts the defaults values correctly 2. Check that tg.Bot just replaces `DefaultValue(obj)` with `obj`, i.e. that it doesn't pass any `DefaultValue` instances to Request. See the docstring of tg.Bot._insert_defaults for details on why we need that As for most defaults, we can't really check the effect, we just check if we're passing the correct kwargs to Request.post. As offline_bot method tests a scattered across the different test files, we do this here in one place. The same test is also run for all the shortcuts (Message.reply_text) etc in the corresponding tests. Finally, there are some tests for Defaults.{parse_mode, quote, allow_sending_without_reply} at the appropriate places, as those are the only things we can actually check. """# Mocking get_me within check_defaults_handling messes with the cached values like# Bot.{bot, username, id, …}` unless we return the expected User object.return_value= (offline_bot.botifbot_method_name.lower().replace("_","")=="getme"elseNone )# Check that ExtBot does the right thingbot_method=getattr(offline_bot,bot_method_name)raw_bot_method=getattr(raw_bot,bot_method_name)>assertawaitcheck_defaults_handling(bot_method,offline_bot,return_value=return_value)tests\test_bot.py:500:__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _tests\auxil\bot_method_checks.py:668:incheck_defaults_handlingraiseexctests\auxil\bot_method_checks.py:636:incheck_defaults_handlingassertawaitmethod(**kwargs)inexpected_return_valuestelegram\ext\_extbot.py:4309:inget_star_transactionsreturnawaitsuper().get_star_transactions(telegram\_bot.py:9405:inget_star_transactionsreturnStarTransactions.de_json(telegram\_payment\stars\startransactions.py:159:inde_jsondata=cls._parse_data(data)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _data=None @staticmethoddef_parse_data(data:JSONDict)->JSONDict:"""Should be called by subclasses that override de_json to ensure that the input is not altered. Whoever calls de_json might still want to use the original input for something else. """>returndata.copy()EAttributeError:'NoneType'objecthasnoattribute'copy'telegram\_telegramobject.py:385:AttributeError
To view more test analytics, go to theTest Analytics Dashboard 📢 Thoughts on this report?Let us know! |
When Ready,closes#4614
Currently, I expect that a bunch of tests will fail as I haven't updated them yet