diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b39c78e..23954be7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 22.10.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks @@ -29,7 +29,7 @@ repos: args: - --ignore-words-list=cachable - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 + rev: v3.0.0 hooks: - id: pyupgrade - repo: https://github.com/PyCQA/isort diff --git a/tests/test_dulwich.py b/tests/test_dulwich.py index a18110dd..16cd3554 100644 --- a/tests/test_dulwich.py +++ b/tests/test_dulwich.py @@ -2,6 +2,7 @@ import threading from io import StringIO from typing import Any, Dict, Iterator +from unittest.mock import AsyncMock import asyncssh import paramiko @@ -12,7 +13,6 @@ USER, Server, ) -from mock import AsyncMock from pytest_mock import MockerFixture from pytest_test_utils.waiters import wait_until @@ -39,7 +39,7 @@ def ssh_conn(request: pytest.FixtureRequest) -> Iterator[Dict[str, Any]]: def _run_server(): try: conn, _ = sock.accept() - except socket.error: + except OSError: return False server.transport = transport = paramiko.Transport(conn) request.addfinalizer(transport.close) diff --git a/tests/test_git.py b/tests/test_git.py index 76969288..749e0519 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -164,7 +164,7 @@ def _gen(i: int): scm.add_commit("file", message=f"{i}") return scm.get_rev() - base, *others = [_gen(i) for i in range(5)] + base, *others = (_gen(i) for i in range(5)) branch_revs = list(git.branch_revs("master", base))[::-1] assert branch_revs == others