mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2026-06-19 07:35:19 +00:00
Bump pre-commit Hooks to Latest Versions (#4858)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
cedfc99e24
commit
957345f6d9
@@ -65,7 +65,7 @@ class TestDatetime:
|
||||
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="pytz not installed")
|
||||
def test_localize_pytz(self):
|
||||
dt = dtm.datetime(2023, 1, 1, 12, 0, 0)
|
||||
import pytz
|
||||
import pytz # noqa: PLC0415
|
||||
|
||||
tzinfo = pytz.timezone("Europe/Berlin")
|
||||
localized_dt = tg_dtm.localize(dt, tzinfo)
|
||||
|
||||
@@ -80,7 +80,7 @@ def caller_func():
|
||||
symlink_to(symlink_file, temp_file)
|
||||
|
||||
sys.path.append(tmp_path.as_posix())
|
||||
from caller_link import caller_func
|
||||
from caller_link import caller_func # noqa: PLC0415
|
||||
|
||||
frame = caller_func()
|
||||
assert was_called_by(frame, temp_file)
|
||||
@@ -111,7 +111,7 @@ def outer_func():
|
||||
symlink_to(symlink_file2, temp_file2)
|
||||
|
||||
sys.path.append(tmp_path.as_posix())
|
||||
from outer_link import outer_func
|
||||
from outer_link import outer_func # noqa: PLC0415
|
||||
|
||||
frame = outer_func()
|
||||
assert was_called_by(frame, temp_file2)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import asyncio
|
||||
import functools
|
||||
import logging
|
||||
from copy import copy
|
||||
from pathlib import Path
|
||||
from warnings import filterwarnings
|
||||
|
||||
@@ -307,8 +308,6 @@ class TestConversationHandler:
|
||||
)
|
||||
|
||||
def test_repr_with_truncation(self):
|
||||
from copy import copy
|
||||
|
||||
states = copy(self.drinking_states)
|
||||
# there are exactly 3 drinking states. adding one more to make sure it's truncated
|
||||
states["extra_to_be_truncated"] = [CommandHandler("foo", self.start)]
|
||||
|
||||
@@ -42,7 +42,7 @@ class TestDefaults:
|
||||
|
||||
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="pytz not installed")
|
||||
def test_pytz_deprecation(self, recwarn):
|
||||
import pytz
|
||||
import pytz # noqa: PLC0415
|
||||
|
||||
with pytest.warns(PTBDeprecationWarning, match="pytz") as record:
|
||||
Defaults(tzinfo=pytz.timezone("Europe/Berlin"))
|
||||
|
||||
@@ -93,7 +93,7 @@ def is_parameter_required_by_tg(field: str) -> bool:
|
||||
def wrap_with_none(tg_parameter: "TelegramParameter", mapped_type: Any, obj: object) -> type:
|
||||
"""Adds `None` to type annotation if the parameter isn't required. Respects ignored params."""
|
||||
# have to import here to avoid circular imports
|
||||
from tests.test_official.exceptions import ignored_param_requirements
|
||||
from tests.test_official.exceptions import ignored_param_requirements # noqa: PLC0415
|
||||
|
||||
if tg_parameter.param_name in ignored_param_requirements(obj.__name__):
|
||||
return mapped_type | type(None)
|
||||
|
||||
Reference in New Issue
Block a user