From 1e4314f36775e5a958b4f40a1de5120820ef5dcb Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 5 Oct 2024 20:30:40 +0200 Subject: [PATCH] win32: do not test for ctime difference ctime is file creation time on windows and is not updated on "touch". --- src/borg/testsuite/archiver/diff_cmd_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/borg/testsuite/archiver/diff_cmd_test.py b/src/borg/testsuite/archiver/diff_cmd_test.py index 8658ad5da6..d4249d8209 100644 --- a/src/borg/testsuite/archiver/diff_cmd_test.py +++ b/src/borg/testsuite/archiver/diff_cmd_test.py @@ -173,7 +173,9 @@ def get_changes(filename, data): unexpected = {"type": "modified", "added": 0, "removed": 0} assert unexpected not in get_changes("input/file_touched", joutput) if not content_only: - assert {"ctime", "mtime"}.issubset({c["type"] for c in get_changes("input/file_touched", joutput)}) + # on win32, ctime is the file creation time and does not change. + expected = {"mtime"} if is_win32 else {"mtime", "ctime"} + assert expected.issubset({c["type"] for c in get_changes("input/file_touched", joutput)}) else: # And if we're doing content-only, don't show the file at all. assert not any(get_changes("input/file_touched", joutput))