From d92d37ee0018c1770a304a052fd9750826ac0986 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Fri, 22 May 2026 00:38:12 -0700 Subject: [PATCH 1/2] Run `copier update` with `--skip-answered` in `update` command --- copier_python/update.py | 2 +- tests/test_update.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/copier_python/update.py b/copier_python/update.py index 6717c52..46220ec 100644 --- a/copier_python/update.py +++ b/copier_python/update.py @@ -34,7 +34,7 @@ def _run(self, repo: RepoWorktree) -> str | None: end_ref = "v" + copier_status["latest_version"] if not copier_status.get("update_available", False): return None - repo.run(["copier", "update", "-l"]) + repo.run(["copier", "update", "--skip-answered"]) status = repo.git_status() if not status: diff --git a/tests/test_update.py b/tests/test_update.py index 742ad48..8cf062a 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -159,7 +159,7 @@ def _run(cmd: Sequence[str], *args: Any, **kwargs: Any) -> Any: return SimpleNamespace(stdout=json.dumps(data)) if mock: return MagicMock() - if tuple(cmd) == ("copier", "update", "-l"): + if tuple(cmd) == ("copier", "update", "--skip-answered"): cmd = [*cmd, "--vcs-ref", DEFAULT_END_REF] cmd = [ ( @@ -299,7 +299,7 @@ def _shell() -> None: cwd=worktree, capture_output=True, ) - expect_run.expect(["copier", "update", "-l"], cwd=worktree) + expect_run.expect(["copier", "update", "--skip-answered"], cwd=worktree) expect_run.expect( ["git", "status", "--porcelain"], cwd=worktree, capture_output=True ) @@ -386,7 +386,7 @@ def test_main_update_with_project( cwd=worktree, capture_output=True, ) - expect_run.expect(["copier", "update", "-l"], cwd=worktree) + expect_run.expect(["copier", "update", "--skip-answered"], cwd=worktree) expect_run.expect( ["git", "status", "--porcelain"], cwd=worktree, capture_output=True ) From 5b572cd5e0114041a237d56e3d54c8eb3edf7748 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Fri, 22 May 2026 21:24:45 -0700 Subject: [PATCH 2/2] Use `copier update --defaults` instead of `--skip-answered` in tests --- tests/test_update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_update.py b/tests/test_update.py index 8cf062a..28dba4c 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -159,8 +159,8 @@ def _run(cmd: Sequence[str], *args: Any, **kwargs: Any) -> Any: return SimpleNamespace(stdout=json.dumps(data)) if mock: return MagicMock() - if tuple(cmd) == ("copier", "update", "--skip-answered"): - cmd = [*cmd, "--vcs-ref", DEFAULT_END_REF] + if tuple(cmd[:3]) == ("copier", "update", "--skip-answered"): + cmd = [*cmd[:2], "--defaults", "--vcs-ref", DEFAULT_END_REF] cmd = [ ( str(self.origin)