mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 06:25:12 +01:00
pre-commit
autoupdate (#3646)
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Co-authored-by: Dmitry Kolomatskiy <58207913+lemontree210@users.noreply.github.com> Co-authored-by: Harshil Mehta <37377066+harshil21@users.noreply.github.com>
This commit is contained in:
parent
d91bc45cdc
commit
83a164e5ef
6 changed files with 12 additions and 11 deletions
|
@ -9,7 +9,7 @@ ci:
|
|||
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.1.0
|
||||
rev: 23.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
args:
|
||||
|
@ -20,7 +20,7 @@ repos:
|
|||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/PyCQA/pylint
|
||||
rev: v2.16.4
|
||||
rev: v3.0.0a6
|
||||
hooks:
|
||||
- id: pylint
|
||||
files: ^(telegram|examples)/.*\.py$
|
||||
|
@ -38,7 +38,7 @@ repos:
|
|||
- aiolimiter~=1.0.0
|
||||
- . # this basically does `pip install -e .`
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.0.1
|
||||
rev: v1.1.1
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy-ptb
|
||||
|
@ -80,7 +80,7 @@ repos:
|
|||
- --diff
|
||||
- --check
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: 'v0.0.259'
|
||||
rev: 'v0.0.261'
|
||||
hooks:
|
||||
- id: ruff
|
||||
name: ruff
|
||||
|
|
|
@ -13,3 +13,6 @@ show-fixes = true
|
|||
ignore = ["PLR2004", "PLR0911", "PLR0912", "PLR0913", "PLR0915"]
|
||||
select = ["E", "F", "I", "PL", "UP", "RUF", "PTH", "C4", "B", "PIE", "SIM", "RET", "RSE",
|
||||
"G", "ISC", "PT"]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"tests/*.py" = ["B018"]
|
||||
|
|
|
@ -60,7 +60,7 @@ DVInput = Union["DefaultValue[DVValueType]", DVValueType, "DefaultValue[None]"]
|
|||
as ``Union[DefaultValue[type], type, DefaultValue[None]]``."""
|
||||
|
||||
RT = TypeVar("RT")
|
||||
SCT = Union[RT, Collection[RT]]
|
||||
SCT = Union[RT, Collection[RT]] # pylint: disable=invalid-name
|
||||
"""Single instance or collection of instances."""
|
||||
|
||||
ReplyMarkup = Union[
|
||||
|
|
|
@ -846,9 +846,9 @@ class ConversationHandler(BaseHandler[Update, CCT]):
|
|||
"Ignoring `conversation_timeout` because the Applications JobQueue is "
|
||||
"not running.",
|
||||
)
|
||||
# Add the new timeout job
|
||||
# checking if the new state is self.END is done in _schedule_job
|
||||
elif isinstance(new_state, asyncio.Task):
|
||||
# Add the new timeout job
|
||||
# checking if the new state is self.END is done in _schedule_job
|
||||
application.create_task(
|
||||
self._schedule_job_delayed(
|
||||
new_state, application, update, context, conversation_key
|
||||
|
|
|
@ -2824,7 +2824,7 @@ class TestBotWithRequest:
|
|||
assert len(messages) == 3 # Check if we sent 3 messages
|
||||
|
||||
# Check if we pinned 3 messages
|
||||
assert all([await i for i in pinned_messages_tasks]) # noqa: PIE802
|
||||
assert all([await i for i in pinned_messages_tasks])
|
||||
assert all(i.done() for i in pinned_messages_tasks) # Check if all tasks are done
|
||||
|
||||
chat = await bot.get_chat(super_group_id) # get the chat to check the pinned message
|
||||
|
|
|
@ -247,9 +247,7 @@ class TestForumMethodsWithRequest:
|
|||
msg = await coro
|
||||
pin_msg_tasks.add(asyncio.create_task(msg.pin()))
|
||||
|
||||
assert (
|
||||
all([await task for task in pin_msg_tasks]) is True # noqa: PIE802
|
||||
), "Message(s) were not pinned"
|
||||
assert all([await task for task in pin_msg_tasks]) is True, "Message(s) were not pinned"
|
||||
|
||||
# We need 2 or more pinned msgs for this to work, else we get Chat_not_modified error
|
||||
result = await bot.unpin_all_forum_topic_messages(forum_group_id, message_thread_id)
|
||||
|
|
Loading…
Reference in a new issue