From dd3cbbc6f0b33ba815add0f39df2c41dfe3b2224 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 4 Oct 2022 12:16:44 +0200 Subject: [PATCH 1/2] Fix the test for already existing branch Introduced in #39 --- cherry_picker/test_cherry_picker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cherry_picker/test_cherry_picker.py b/cherry_picker/test_cherry_picker.py index b62c74b..6956c4d 100644 --- a/cherry_picker/test_cherry_picker.py +++ b/cherry_picker/test_cherry_picker.py @@ -986,12 +986,13 @@ def test_backport_cherry_pick_crash_ignored( def test_backport_cherry_pick_branch_already_exists( - tmp_git_repo_dir, git_branch, git_add, git_commit, git_checkout + tmp_git_repo_dir, git_branch, git_add, git_commit, git_checkout, git_remote ): cherry_pick_target_branches = ("3.8",) pr_remote = "origin" test_file = "some.file" tmp_git_repo_dir.join(test_file).write("some contents") + git_remote("add", pr_remote, "https://github.com/python/cpython.git") git_branch(cherry_pick_target_branches[0]) git_branch( f"{pr_remote}/{cherry_pick_target_branches[0]}", cherry_pick_target_branches[0] From 3bc9c1daad5c4c889d13bce7e02d0538c82907f4 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 4 Oct 2022 12:21:15 +0200 Subject: [PATCH 2/2] Fix the test for backport pause and continue Introduced in #43 --- cherry_picker/test_cherry_picker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cherry_picker/test_cherry_picker.py b/cherry_picker/test_cherry_picker.py index 6956c4d..b76616d 100644 --- a/cherry_picker/test_cherry_picker.py +++ b/cherry_picker/test_cherry_picker.py @@ -1053,12 +1053,13 @@ def test_backport_success( @pytest.mark.parametrize("already_committed", (True, False)) @pytest.mark.parametrize("push", (True, False)) def test_backport_pause_and_continue( - tmp_git_repo_dir, git_branch, git_add, git_commit, git_checkout, git_reset, already_committed, push + tmp_git_repo_dir, git_branch, git_add, git_commit, git_checkout, git_reset, git_remote, already_committed, push ): cherry_pick_target_branches = ("3.8",) pr_remote = "origin" test_file = "some.file" tmp_git_repo_dir.join(test_file).write("some contents") + git_remote("add", pr_remote, "https://github.com/python/cpython.git") git_branch(cherry_pick_target_branches[0]) git_branch( f"{pr_remote}/{cherry_pick_target_branches[0]}", cherry_pick_target_branches[0]