From f452c132fa683515f84974cb9ac38303325ff8b2 Mon Sep 17 00:00:00 2001 From: Lucas Molinari <101225122+lucasmolinari@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:15:33 -0300 Subject: [PATCH] Move Handler Files to `_handlers` Subdirectory (#4064) --- AUTHORS.rst | 1 + telegram/ext/__init__.py | 34 +++++++++---------- telegram/ext/_application.py | 8 ++--- telegram/ext/_handlers/__init__.py | 0 .../basehandler.py} | 0 .../callbackqueryhandler.py} | 2 +- .../chatjoinrequesthandler.py} | 2 +- .../chatmemberhandler.py} | 2 +- .../choseninlineresulthandler.py} | 2 +- .../commandhandler.py} | 2 +- .../conversationhandler.py} | 14 ++++---- .../inlinequeryhandler.py} | 2 +- .../messagehandler.py} | 2 +- .../pollanswerhandler.py} | 2 +- .../pollhandler.py} | 2 +- .../precheckoutqueryhandler.py} | 2 +- .../prefixhandler.py} | 2 +- .../shippingqueryhandler.py} | 2 +- .../stringcommandhandler.py} | 2 +- .../stringregexhandler.py} | 2 +- .../typehandler.py} | 2 +- tests/_files/test_inputmedia.py | 4 +-- tests/ext/test_basehandler.py | 2 +- tests/ext/test_conversationhandler.py | 8 +++-- tests/test_bot.py | 4 +-- 25 files changed, 55 insertions(+), 50 deletions(-) create mode 100644 telegram/ext/_handlers/__init__.py rename telegram/ext/{_basehandler.py => _handlers/basehandler.py} (100%) rename telegram/ext/{_callbackqueryhandler.py => _handlers/callbackqueryhandler.py} (99%) rename telegram/ext/{_chatjoinrequesthandler.py => _handlers/chatjoinrequesthandler.py} (98%) rename telegram/ext/{_chatmemberhandler.py => _handlers/chatmemberhandler.py} (98%) rename telegram/ext/{_choseninlineresulthandler.py => _handlers/choseninlineresulthandler.py} (98%) rename telegram/ext/{_commandhandler.py => _handlers/commandhandler.py} (99%) rename telegram/ext/{_conversationhandler.py => _handlers/conversationhandler.py} (98%) rename telegram/ext/{_inlinequeryhandler.py => _handlers/inlinequeryhandler.py} (99%) rename telegram/ext/{_messagehandler.py => _handlers/messagehandler.py} (98%) rename telegram/ext/{_pollanswerhandler.py => _handlers/pollanswerhandler.py} (97%) rename telegram/ext/{_pollhandler.py => _handlers/pollhandler.py} (97%) rename telegram/ext/{_precheckoutqueryhandler.py => _handlers/precheckoutqueryhandler.py} (98%) rename telegram/ext/{_prefixhandler.py => _handlers/prefixhandler.py} (99%) rename telegram/ext/{_shippingqueryhandler.py => _handlers/shippingqueryhandler.py} (97%) rename telegram/ext/{_stringcommandhandler.py => _handlers/stringcommandhandler.py} (98%) rename telegram/ext/{_stringregexhandler.py => _handlers/stringregexhandler.py} (98%) rename telegram/ext/{_typehandler.py => _handlers/typehandler.py} (98%) diff --git a/AUTHORS.rst b/AUTHORS.rst index f4e76fce8..d284dafa0 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -76,6 +76,7 @@ The following wonderful people contributed directly or indirectly to this projec - `Loo Zheng Yuan `_ - `LRezende `_ - `Luca Bellanti `_ +- `Lucas Molinari `_ - `macrojames `_ - `Matheus Lemos `_ - `Michael Dix `_ diff --git a/telegram/ext/__init__.py b/telegram/ext/__init__.py index e3449a935..95826a754 100644 --- a/telegram/ext/__init__.py +++ b/telegram/ext/__init__.py @@ -63,32 +63,32 @@ from . import filters from ._aioratelimiter import AIORateLimiter from ._application import Application, ApplicationHandlerStop from ._applicationbuilder import ApplicationBuilder -from ._basehandler import BaseHandler from ._basepersistence import BasePersistence, PersistenceInput from ._baseratelimiter import BaseRateLimiter from ._baseupdateprocessor import BaseUpdateProcessor, SimpleUpdateProcessor from ._callbackcontext import CallbackContext from ._callbackdatacache import CallbackDataCache, InvalidCallbackData -from ._callbackqueryhandler import CallbackQueryHandler -from ._chatjoinrequesthandler import ChatJoinRequestHandler -from ._chatmemberhandler import ChatMemberHandler -from ._choseninlineresulthandler import ChosenInlineResultHandler -from ._commandhandler import CommandHandler from ._contexttypes import ContextTypes -from ._conversationhandler import ConversationHandler from ._defaults import Defaults from ._dictpersistence import DictPersistence from ._extbot import ExtBot -from ._inlinequeryhandler import InlineQueryHandler +from ._handlers.basehandler import BaseHandler +from ._handlers.callbackqueryhandler import CallbackQueryHandler +from ._handlers.chatjoinrequesthandler import ChatJoinRequestHandler +from ._handlers.chatmemberhandler import ChatMemberHandler +from ._handlers.choseninlineresulthandler import ChosenInlineResultHandler +from ._handlers.commandhandler import CommandHandler +from ._handlers.conversationhandler import ConversationHandler +from ._handlers.inlinequeryhandler import InlineQueryHandler +from ._handlers.messagehandler import MessageHandler +from ._handlers.pollanswerhandler import PollAnswerHandler +from ._handlers.pollhandler import PollHandler +from ._handlers.precheckoutqueryhandler import PreCheckoutQueryHandler +from ._handlers.prefixhandler import PrefixHandler +from ._handlers.shippingqueryhandler import ShippingQueryHandler +from ._handlers.stringcommandhandler import StringCommandHandler +from ._handlers.stringregexhandler import StringRegexHandler +from ._handlers.typehandler import TypeHandler from ._jobqueue import Job, JobQueue -from ._messagehandler import MessageHandler from ._picklepersistence import PicklePersistence -from ._pollanswerhandler import PollAnswerHandler -from ._pollhandler import PollHandler -from ._precheckoutqueryhandler import PreCheckoutQueryHandler -from ._prefixhandler import PrefixHandler -from ._shippingqueryhandler import ShippingQueryHandler -from ._stringcommandhandler import StringCommandHandler -from ._stringregexhandler import StringRegexHandler -from ._typehandler import TypeHandler from ._updater import Updater diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index 52ce03321..134d80fa6 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -64,10 +64,10 @@ from telegram._utils.repr import build_repr_with_selected_attrs from telegram._utils.types import SCT, DVType, ODVInput from telegram._utils.warnings import warn from telegram.error import TelegramError -from telegram.ext._basehandler import BaseHandler from telegram.ext._basepersistence import BasePersistence from telegram.ext._contexttypes import ContextTypes from telegram.ext._extbot import ExtBot +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._updater import Updater from telegram.ext._utils.stack import was_called_by from telegram.ext._utils.trackingdict import TrackingDict @@ -494,7 +494,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica # Unfortunately due to circular imports this has to be here # pylint: disable=import-outside-toplevel - from telegram.ext._conversationhandler import ConversationHandler + from telegram.ext._handlers.conversationhandler import ConversationHandler # Initialize the persistent conversation handlers with the stored states for handler in itertools.chain.from_iterable(self.handlers.values()): @@ -1304,7 +1304,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica """ # Unfortunately due to circular imports this has to be here # pylint: disable=import-outside-toplevel - from telegram.ext._conversationhandler import ConversationHandler + from telegram.ext._handlers.conversationhandler import ConversationHandler if not isinstance(handler, BaseHandler): raise TypeError(f"handler is not an instance of {BaseHandler.__name__}") @@ -1650,7 +1650,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica # Unfortunately due to circular imports this has to be here # pylint: disable=import-outside-toplevel - from telegram.ext._conversationhandler import PendingState + from telegram.ext._handlers.conversationhandler import PendingState for name, (key, new_state) in itertools.chain.from_iterable( zip(itertools.repeat(name), states_dict.pop_accessed_write_items()) diff --git a/telegram/ext/_handlers/__init__.py b/telegram/ext/_handlers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/telegram/ext/_basehandler.py b/telegram/ext/_handlers/basehandler.py similarity index 100% rename from telegram/ext/_basehandler.py rename to telegram/ext/_handlers/basehandler.py diff --git a/telegram/ext/_callbackqueryhandler.py b/telegram/ext/_handlers/callbackqueryhandler.py similarity index 99% rename from telegram/ext/_callbackqueryhandler.py rename to telegram/ext/_handlers/callbackqueryhandler.py index 0cf5c5161..264fc6af7 100644 --- a/telegram/ext/_callbackqueryhandler.py +++ b/telegram/ext/_handlers/callbackqueryhandler.py @@ -24,7 +24,7 @@ from typing import TYPE_CHECKING, Any, Callable, Match, Optional, Pattern, TypeV from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_chatjoinrequesthandler.py b/telegram/ext/_handlers/chatjoinrequesthandler.py similarity index 98% rename from telegram/ext/_chatjoinrequesthandler.py rename to telegram/ext/_handlers/chatjoinrequesthandler.py index 59009d1d5..838947580 100644 --- a/telegram/ext/_chatjoinrequesthandler.py +++ b/telegram/ext/_handlers/chatjoinrequesthandler.py @@ -23,7 +23,7 @@ from typing import FrozenSet, Optional from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import RT, SCT, DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback diff --git a/telegram/ext/_chatmemberhandler.py b/telegram/ext/_handlers/chatmemberhandler.py similarity index 98% rename from telegram/ext/_chatmemberhandler.py rename to telegram/ext/_handlers/chatmemberhandler.py index 6edf39641..a5c5c0d8b 100644 --- a/telegram/ext/_chatmemberhandler.py +++ b/telegram/ext/_handlers/chatmemberhandler.py @@ -22,7 +22,7 @@ from typing import Final, Optional, TypeVar from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/telegram/ext/_choseninlineresulthandler.py b/telegram/ext/_handlers/choseninlineresulthandler.py similarity index 98% rename from telegram/ext/_choseninlineresulthandler.py rename to telegram/ext/_handlers/choseninlineresulthandler.py index 2e9a2c89a..a63530688 100644 --- a/telegram/ext/_choseninlineresulthandler.py +++ b/telegram/ext/_handlers/choseninlineresulthandler.py @@ -23,7 +23,7 @@ from typing import TYPE_CHECKING, Any, Match, Optional, Pattern, TypeVar, Union, from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/telegram/ext/_commandhandler.py b/telegram/ext/_handlers/commandhandler.py similarity index 99% rename from telegram/ext/_commandhandler.py rename to telegram/ext/_handlers/commandhandler.py index 13bacfbb8..710b38cb9 100644 --- a/telegram/ext/_commandhandler.py +++ b/telegram/ext/_handlers/commandhandler.py @@ -24,7 +24,7 @@ from telegram import MessageEntity, Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import SCT, DVType from telegram.ext import filters as filters_module -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, FilterDataDict, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_conversationhandler.py b/telegram/ext/_handlers/conversationhandler.py similarity index 98% rename from telegram/ext/_conversationhandler.py rename to telegram/ext/_handlers/conversationhandler.py index 647073385..46901c458 100644 --- a/telegram/ext/_conversationhandler.py +++ b/telegram/ext/_handlers/conversationhandler.py @@ -42,14 +42,14 @@ from telegram._utils.repr import build_repr_with_selected_attrs from telegram._utils.types import DVType from telegram._utils.warnings import warn from telegram.ext._application import ApplicationHandlerStop -from telegram.ext._basehandler import BaseHandler -from telegram.ext._callbackqueryhandler import CallbackQueryHandler -from telegram.ext._choseninlineresulthandler import ChosenInlineResultHandler from telegram.ext._extbot import ExtBot -from telegram.ext._inlinequeryhandler import InlineQueryHandler -from telegram.ext._stringcommandhandler import StringCommandHandler -from telegram.ext._stringregexhandler import StringRegexHandler -from telegram.ext._typehandler import TypeHandler +from telegram.ext._handlers.basehandler import BaseHandler +from telegram.ext._handlers.callbackqueryhandler import CallbackQueryHandler +from telegram.ext._handlers.choseninlineresulthandler import ChosenInlineResultHandler +from telegram.ext._handlers.inlinequeryhandler import InlineQueryHandler +from telegram.ext._handlers.stringcommandhandler import StringCommandHandler +from telegram.ext._handlers.stringregexhandler import StringRegexHandler +from telegram.ext._handlers.typehandler import TypeHandler from telegram.ext._utils.trackingdict import TrackingDict from telegram.ext._utils.types import CCT, ConversationDict, ConversationKey diff --git a/telegram/ext/_inlinequeryhandler.py b/telegram/ext/_handlers/inlinequeryhandler.py similarity index 99% rename from telegram/ext/_inlinequeryhandler.py rename to telegram/ext/_handlers/inlinequeryhandler.py index f2c146d6d..7a0158435 100644 --- a/telegram/ext/_inlinequeryhandler.py +++ b/telegram/ext/_handlers/inlinequeryhandler.py @@ -23,7 +23,7 @@ from typing import TYPE_CHECKING, Any, List, Match, Optional, Pattern, TypeVar, from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_messagehandler.py b/telegram/ext/_handlers/messagehandler.py similarity index 98% rename from telegram/ext/_messagehandler.py rename to telegram/ext/_handlers/messagehandler.py index 0e90635c3..148f4949a 100644 --- a/telegram/ext/_messagehandler.py +++ b/telegram/ext/_handlers/messagehandler.py @@ -23,7 +23,7 @@ from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType from telegram.ext import filters as filters_module -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_pollanswerhandler.py b/telegram/ext/_handlers/pollanswerhandler.py similarity index 97% rename from telegram/ext/_pollanswerhandler.py rename to telegram/ext/_handlers/pollanswerhandler.py index 2aeec1757..ea30d645d 100644 --- a/telegram/ext/_pollanswerhandler.py +++ b/telegram/ext/_handlers/pollanswerhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_pollhandler.py b/telegram/ext/_handlers/pollhandler.py similarity index 97% rename from telegram/ext/_pollhandler.py rename to telegram/ext/_handlers/pollhandler.py index 453afea63..2aac563dc 100644 --- a/telegram/ext/_pollhandler.py +++ b/telegram/ext/_handlers/pollhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_precheckoutqueryhandler.py b/telegram/ext/_handlers/precheckoutqueryhandler.py similarity index 98% rename from telegram/ext/_precheckoutqueryhandler.py rename to telegram/ext/_handlers/precheckoutqueryhandler.py index 3c193cb73..38504cd5d 100644 --- a/telegram/ext/_precheckoutqueryhandler.py +++ b/telegram/ext/_handlers/precheckoutqueryhandler.py @@ -25,7 +25,7 @@ from typing import Optional, Pattern, TypeVar, Union from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/telegram/ext/_prefixhandler.py b/telegram/ext/_handlers/prefixhandler.py similarity index 99% rename from telegram/ext/_prefixhandler.py rename to telegram/ext/_handlers/prefixhandler.py index 9b60aebe6..05034be6d 100644 --- a/telegram/ext/_prefixhandler.py +++ b/telegram/ext/_handlers/prefixhandler.py @@ -24,7 +24,7 @@ from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import SCT, DVType from telegram.ext import filters as filters_module -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_shippingqueryhandler.py b/telegram/ext/_handlers/shippingqueryhandler.py similarity index 97% rename from telegram/ext/_shippingqueryhandler.py rename to telegram/ext/_handlers/shippingqueryhandler.py index 7c840acb4..f84077a78 100644 --- a/telegram/ext/_shippingqueryhandler.py +++ b/telegram/ext/_handlers/shippingqueryhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_stringcommandhandler.py b/telegram/ext/_handlers/stringcommandhandler.py similarity index 98% rename from telegram/ext/_stringcommandhandler.py rename to telegram/ext/_handlers/stringcommandhandler.py index 67c7b62b5..6be9b9a47 100644 --- a/telegram/ext/_stringcommandhandler.py +++ b/telegram/ext/_handlers/stringcommandhandler.py @@ -22,7 +22,7 @@ from typing import TYPE_CHECKING, Any, List, Optional from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, RT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_stringregexhandler.py b/telegram/ext/_handlers/stringregexhandler.py similarity index 98% rename from telegram/ext/_stringregexhandler.py rename to telegram/ext/_handlers/stringregexhandler.py index 539a92952..11050760c 100644 --- a/telegram/ext/_stringregexhandler.py +++ b/telegram/ext/_handlers/stringregexhandler.py @@ -23,7 +23,7 @@ from typing import TYPE_CHECKING, Any, Match, Optional, Pattern, TypeVar, Union from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_typehandler.py b/telegram/ext/_handlers/typehandler.py similarity index 98% rename from telegram/ext/_typehandler.py rename to telegram/ext/_handlers/typehandler.py index 90a68cf8f..158611fa5 100644 --- a/telegram/ext/_typehandler.py +++ b/telegram/ext/_handlers/typehandler.py @@ -22,7 +22,7 @@ from typing import Optional, Type, TypeVar from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._basehandler import BaseHandler +from telegram.ext._handlers.basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/tests/_files/test_inputmedia.py b/tests/_files/test_inputmedia.py index 231670367..93567a152 100644 --- a/tests/_files/test_inputmedia.py +++ b/tests/_files/test_inputmedia.py @@ -607,7 +607,7 @@ class TestSendMediaGroupWithRequest: assert len(messages) == 3 assert all(isinstance(mes, Message) for mes in messages) assert all(mes.media_group_id == messages[0].media_group_id for mes in messages) - assert all(mes.caption == f"photo {idx+1}" for idx, mes in enumerate(messages)) + assert all(mes.caption == f"photo {idx + 1}" for idx, mes in enumerate(messages)) assert all( mes.caption_entities == (MessageEntity(MessageEntity.BOLD, 0, 5),) for mes in messages ) @@ -742,7 +742,7 @@ class TestSendMediaGroupWithRequest: assert len(messages) == 3 assert all(isinstance(mes, Message) for mes in messages) assert all(mes.media_group_id == messages[0].media_group_id for mes in messages) - assert all(mes.caption == f"photo {idx+1}" for idx, mes in enumerate(messages)) + assert all(mes.caption == f"photo {idx + 1}" for idx, mes in enumerate(messages)) assert all( mes.caption_entities == (MessageEntity(MessageEntity.BOLD, 0, 5),) for mes in messages diff --git a/tests/ext/test_basehandler.py b/tests/ext/test_basehandler.py index 453cf219e..c61258266 100644 --- a/tests/ext/test_basehandler.py +++ b/tests/ext/test_basehandler.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Lesser Public License # along with this program. If not, see [http://www.gnu.org/licenses/]. -from telegram.ext._basehandler import BaseHandler +from telegram.ext import BaseHandler from tests.auxil.slots import mro_slots diff --git a/tests/ext/test_conversationhandler.py b/tests/ext/test_conversationhandler.py index 433ce413a..72f678951 100644 --- a/tests/ext/test_conversationhandler.py +++ b/tests/ext/test_conversationhandler.py @@ -725,7 +725,7 @@ class TestConversationHandler: assert recwarn[0].category is PTBUserWarning assert ( Path(recwarn[0].filename) - == PROJECT_ROOT_PATH / "telegram" / "ext" / "_conversationhandler.py" + == PROJECT_ROOT_PATH / "telegram" / "ext" / "_handlers" / "conversationhandler.py" ), "wrong stacklevel!" assert ( str(recwarn[0].message) @@ -1105,7 +1105,11 @@ class TestConversationHandler: assert warning.category is PTBUserWarning assert ( Path(warning.filename) - == PROJECT_ROOT_PATH / "telegram" / "ext" / "_conversationhandler.py" + == PROJECT_ROOT_PATH + / "telegram" + / "ext" + / "_handlers" + / "conversationhandler.py" ), "wrong stacklevel!" # now set app.job_queue back to it's original value diff --git a/tests/test_bot.py b/tests/test_bot.py index 4ef7f6ebf..e572a8714 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -3173,8 +3173,8 @@ class TestBotWithRequest: assert await bot.set_my_commands(commands) for i, bc in enumerate(await bot.get_my_commands()): - assert bc.command == f"cmd{i+1}" - assert bc.description == f"descr{i+1}" + assert bc.command == f"cmd{i + 1}" + assert bc.description == f"descr{i + 1}" async def test_get_set_delete_my_commands_with_scope(self, bot, super_group_id, chat_id): group_cmds = [BotCommand("group_cmd", "visible to this supergroup only")]