From aa7c5fe9d4f5fae92a93d5d17454e1b6f6acdc29 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Sun, 6 Feb 2022 10:52:43 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- src/darker/black_compat.py | 7 +------ src/darker/tests/test_main.py | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/darker/black_compat.py b/src/darker/black_compat.py index f5eb862ec..db5f58f59 100644 --- a/src/darker/black_compat.py +++ b/src/darker/black_compat.py @@ -6,11 +6,6 @@ def find_project_root(srcs: Sequence[str]) -> Path: root = black_find_project_root(tuple(srcs or ["."])) - if isinstance(root, tuple): - # Black >= 22.1 - return root[0] - else: - # Black < 22 - return root + return root[0] if isinstance(root, tuple) else root find_project_root.cache_clear = black_find_project_root.cache_clear diff --git a/src/darker/tests/test_main.py b/src/darker/tests/test_main.py index 1277c5222..4d6d6c2ec 100644 --- a/src/darker/tests/test_main.py +++ b/src/darker/tests/test_main.py @@ -205,7 +205,7 @@ def test_format_edited_parts_all_unchanged(git_repo, monkeypatch): ) ) - assert result == [] + assert not result def test_format_edited_parts_ast_changed(git_repo, caplog): @@ -273,7 +273,7 @@ def test_format_edited_parts_isort_on_already_formatted(git_repo): report_unmodified=False, ) - assert list(result) == [] + assert not list(result) @pytest.mark.kwparametrize(