Skip to content

Commit 888adc2

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 1c52fc9 commit 888adc2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/pds/ingress/service/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import shutil
22
from importlib.resources import files
3+
import filecmp
34

45
import pytest
56

@@ -14,4 +15,10 @@ def version_txt_in_test_config():
1415
"""
1516
src = str(files("pds.ingress").joinpath("VERSION.txt"))
1617
dst = str(files("tests.pds.ingress").joinpath("service/config/VERSION.txt"))
17-
shutil.copy(src, dst)
18+
try:
19+
# Only copy when the destination is missing or has different content,
20+
# to avoid unnecessarily updating the file's mtime in the working tree.
21+
if not filecmp.cmp(src, dst, shallow=False):
22+
shutil.copy(src, dst)
23+
except FileNotFoundError:
24+
shutil.copy(src, dst)

0 commit comments

Comments
 (0)