From b317f0f61694d4cdd243d34dc7d3bb13e7c1af79 Mon Sep 17 00:00:00 2001 From: Sven Steinbauer Date: Fri, 8 Mar 2024 11:47:14 +0000 Subject: [PATCH] Fix failing tests With the added diff filter some tests needed updating to reflect the change --- src/darker/tests/test_git.py | 3 --- src/darker/tests/test_main_revision.py | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/darker/tests/test_git.py b/src/darker/tests/test_git.py index 649e9b7f4..1d2dcb4dc 100644 --- a/src/darker/tests/test_git.py +++ b/src/darker/tests/test_git.py @@ -267,7 +267,6 @@ def test_git_get_modified_python_files(git_repo, modify_paths, paths, expect): _description="from master to worktree and index on branch", revrange="master..", expect={ - "del_master.py", "mod_master.py", "mod_both.py", "mod_branch.py", @@ -283,7 +282,6 @@ def test_git_get_modified_python_files(git_repo, modify_paths, paths, expect): ), revrange="master..HEAD", expect={ - "del_master.py", "mod_master.py", "mod_both.py", "mod_branch.py", @@ -293,7 +291,6 @@ def test_git_get_modified_python_files(git_repo, modify_paths, paths, expect): _description="from master to branch, excluding worktree and index", revrange="master..branch", expect={ - "del_master.py", "mod_master.py", "mod_both.py", "mod_branch.py", diff --git a/src/darker/tests/test_main_revision.py b/src/darker/tests/test_main_revision.py index 7d885f866..029f8b8c5 100644 --- a/src/darker/tests/test_main_revision.py +++ b/src/darker/tests/test_main_revision.py @@ -99,7 +99,9 @@ worktree_content=b"USERMOD=1\n", expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"}, ), - dict(revision="HEAD~2", worktree_content=b"ORIGINAL=1\n", expect={"+1", "+1M0"}), + # These are empty because git diff reports these are renamed files. + # We only care about added or modified files. See PR #454 + dict(revision="HEAD~2", worktree_content=b"ORIGINAL=1\n", expect=set()), dict( revision="HEAD~2", worktree_content=b"MODIFIED=1\n",