diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index 73703204e..529a1ff38 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -351,7 +351,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AbstractAsyncContextManager) if self._job_queue is None: warn( "No `JobQueue` set up. To use `JobQueue`, you must install PTB via " - "`pip install python-telegram-bot[job_queue]`.", + "`pip install python-telegram-bot[job-queue]`.", stacklevel=2, ) return self._job_queue diff --git a/telegram/ext/_callbackcontext.py b/telegram/ext/_callbackcontext.py index 678c8b4cc..1fb1c6308 100644 --- a/telegram/ext/_callbackcontext.py +++ b/telegram/ext/_callbackcontext.py @@ -386,7 +386,7 @@ class CallbackContext(Generic[BT, UD, CD, BD]): if self._application._job_queue is None: # pylint: disable=protected-access warn( "No `JobQueue` set up. To use `JobQueue`, you must install PTB via " - "`pip install python-telegram-bot[job_queue]`.", + "`pip install python-telegram-bot[job-queue]`.", stacklevel=2, ) return self._application._job_queue # pylint: disable=protected-access diff --git a/tests/test_application.py b/tests/test_application.py index e66e7825c..8ba30c3c7 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -204,7 +204,7 @@ class TestApplication: def test_job_queue(self, bot, app, recwarn): expected_warning = ( "No `JobQueue` set up. To use `JobQueue`, you must install PTB via " - "`pip install python-telegram-bot[job_queue]`." + "`pip install python-telegram-bot[job-queue]`." ) assert app.job_queue is app._job_queue application = ApplicationBuilder().token(bot.token).job_queue(None).build() diff --git a/tests/test_callbackcontext.py b/tests/test_callbackcontext.py index d62c58354..7bba2d9a6 100644 --- a/tests/test_callbackcontext.py +++ b/tests/test_callbackcontext.py @@ -61,7 +61,7 @@ class TestCallbackContext: def test_job_queue(self, bot, app, recwarn): expected_warning = ( "No `JobQueue` set up. To use `JobQueue`, you must install PTB via " - "`pip install python-telegram-bot[job_queue]`." + "`pip install python-telegram-bot[job-queue]`." ) callback_context = CallbackContext(app)