From 09c252fa1af8dbe6775157d59f70cf79b3135dff Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:17:36 +0300 Subject: [PATCH] test,refactor: misc fixes for linters --- pyproject.toml | 1 + src/darker/tests/test_main_isort.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 57731a09c..d19411ebb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ ignore = [ "ANN201", # Missing return type annotation for public function "ANN204", # Missing return type annotation for special method `__init__` "C408", # Unnecessary `dict` call (rewrite as a literal) + "PLR0913", # Too many arguments in function definition (n > 5) "S101", # Use of `assert` detected ] diff --git a/src/darker/tests/test_main_isort.py b/src/darker/tests/test_main_isort.py index 954ad7067..ed296d8ba 100644 --- a/src/darker/tests/test_main_isort.py +++ b/src/darker/tests/test_main_isort.py @@ -15,9 +15,11 @@ pytestmark = pytest.mark.usefixtures("find_project_root_cache_clear") -def test_isort_option_without_isort(git_repo, caplog): +def test_isort_option_without_isort(git_repo): # noqa: ARG001 """Without isort, provide isort install instructions and error.""" - with isort_present(False), patch.object( + # The `git_repo` fixture ensures test is not run in the Darker repository clone in + # CI builds. It helps avoid a NixOS test issue. + with isort_present(present=False), patch.object( darker.__main__, "isort", None, ), pytest.raises(MissingPackageError) as exc_info: @@ -29,7 +31,7 @@ def test_isort_option_without_isort(git_repo, caplog): ) -@pytest.fixture +@pytest.fixture() def run_isort(git_repo, monkeypatch, caplog, request): """Fixture for running Darker with requested arguments and a patched `isort`.