Skip to content

Commit fe7c12e

Browse files
nikzartclaude
andcommitted
test: assert only template-rendered files are visible to fileglob during update
Whether files added by the user in the destination are visible to filesystem filters during an update depends on whether the update algorithm renders into the user-specified destination, which is an implementation detail that may change (copier-org#2376). Assert only the invariant shared by both algorithms: rendering happens in the destination being rendered, never the invocation directory. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 410cef5 commit fe7c12e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/test_updatediff.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def test_update_render_cwd_is_destination(
596596
git_init("v1")
597597
git("tag", "v1")
598598
run_copy(str(src), dst, defaults=True, overwrite=True)
599-
build_file_tree({(dst / "a.txt"): "", (invocation / "decoy.txt"): ""})
599+
build_file_tree({(invocation / "decoy.txt"): ""})
600600
with local.cwd(dst):
601601
git_init("copied")
602602
with local.cwd(src):
@@ -608,7 +608,13 @@ def test_update_render_cwd_is_destination(
608608
cwd_before = Path.cwd()
609609
run_update(dst, defaults=True, overwrite=True)
610610
assert Path.cwd() == cwd_before
611-
assert (dst / "fileglob.txt").read_text() == "['a.txt', 'version.txt']"
611+
# NOTE: Deliberately assert only files rendered by the template, not files
612+
# added by the user in the destination. Whether the latter are visible to
613+
# filesystem filters during an update depends on whether the update
614+
# algorithm renders into the user-specified destination, which is an
615+
# implementation detail that may change.
616+
# https://github.com/copier-org/copier/pull/2754#discussion_r3529453935
617+
assert (dst / "fileglob.txt").read_text() == "['version.txt']"
612618

613619

614620
@pytest.mark.parametrize("subproject_path", [Path(), Path("subproject")])

0 commit comments

Comments
 (0)