Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit hooks #449

Merged
merged 7 commits into from Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
@@ -1,32 +1,31 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
exclude: rst$
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.4.0
hooks:
- id: yesqa
- repo: https://github.com/Zac-HD/shed
rev: 0.6.0 # 0.7 does not support Python 3.7
rev: 0.10.7
hooks:
- id: shed
args:
- --refactor
- --py37-plus
types_or:
- python
- markdown
- rst
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.1
rev: 0.2.2
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '2', --offset, '0']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -37,8 +36,8 @@ repos:
- id: check-xml
- id: check-yaml
- id: debug-statements
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
language_version: python3
Expand All @@ -47,7 +46,7 @@ repos:
hooks:
- id: python-use-type-annotations
- repo: https://github.com/rhysd/actionlint
rev: v1.6.8
rev: v1.6.22
hooks:
- id: actionlint-docker
args:
Expand All @@ -58,7 +57,7 @@ repos:
- -ignore
- 'SC1004:'
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.9.1
rev: 0.19.2
hooks:
- id: check-github-actions
ci:
Expand Down
24 changes: 11 additions & 13 deletions pytest_asyncio/plugin.py
Expand Up @@ -25,7 +25,7 @@
)

import pytest
from pytest import Function, Session, Item
from pytest import Function, Item, Session

if sys.version_info >= (3, 8):
from typing import Literal
Expand Down Expand Up @@ -89,11 +89,10 @@ def fixture(
scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = ...,
params: Optional[Iterable[object]] = ...,
autouse: bool = ...,
ids: Optional[
Union[
Iterable[Union[None, str, float, int, bool]],
Callable[[Any], Optional[object]],
]
ids: Union[
Iterable[Union[str, float, int, bool, None]],
Callable[[Any], Optional[object]],
None,
] = ...,
name: Optional[str] = ...,
) -> FixtureFunction:
Expand All @@ -107,11 +106,10 @@ def fixture(
scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = ...,
params: Optional[Iterable[object]] = ...,
autouse: bool = ...,
ids: Optional[
Union[
Iterable[Union[None, str, float, int, bool]],
Callable[[Any], Optional[object]],
]
ids: Union[
Iterable[Union[str, float, int, bool, None]],
Callable[[Any], Optional[object]],
None,
] = ...,
name: Optional[str] = None,
) -> FixtureFunctionMarker:
Expand Down Expand Up @@ -330,9 +328,9 @@ async def setup():

@pytest.hookimpl(tryfirst=True)
def pytest_pycollect_makeitem(
collector: Union[pytest.Module, pytest.Class], name: str, obj: object
collector: Union[pytest.Module, pytest.Class], name: str, obj: object
) -> Union[
None, pytest.Item, pytest.Collector, List[Union[pytest.Item, pytest.Collector]]
pytest.Item, pytest.Collector, List[Union[pytest.Item, pytest.Collector]], None
]:
"""A pytest hook to collect asyncio coroutines."""
if not collector.funcnamefilter(name):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytest_min_version_warning.py
Expand Up @@ -5,7 +5,7 @@

@pytest.mark.skipif(
pytest.__version__ < "7.0.0",
reason="The warning shouldn't be present when run with recent pytest versions"
reason="The warning shouldn't be present when run with recent pytest versions",
)
@pytest.mark.parametrize("mode", ("auto", "strict"))
def test_pytest_min_version_warning_is_not_triggered_for_pytest_7(testdir, mode):
Expand Down