Skip to content

Commit 3a25dfc

Browse files
committed
test(git): address review feedback for get_filenames_in_commit tests
- Add a prior commit to verify only the last commit's files are returned - Use strict equality assertion instead of in
1 parent 926911d commit 3a25dfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_git.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,13 @@ def test_commit_with_spaces_in_path(
390390
@pytest.mark.usefixtures("tmp_commitizen_project")
391391
def test_get_filenames_in_commit(util: UtilFixture):
392392
"""Test get_filenames_in_commit returns filenames from the last commit."""
393+
util.create_file_and_commit("feat: old feature", filename="old_file.txt")
394+
393395
filename = "test_feature_file.txt"
394396
util.create_file_and_commit("feat: add new feature", filename=filename)
395397

396398
filenames = git.get_filenames_in_commit()
397-
assert filename in filenames
399+
assert [filename] == filenames
398400

399401

400402
@pytest.mark.usefixtures("tmp_commitizen_project")

0 commit comments

Comments
 (0)