From 94484ca3aa64407254bb3b586e8bf450f5fac0f7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 20:22:26 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0) - [github.com/asottile/pyupgrade: v2.38.2 → v3.0.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.0.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From ac65ae33c058cdf503775054b06ed31435c8bc10 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 20:22:47 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_dulwich.py | 4 ++-- tests/test_git.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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