From f3507a0ba075e35309aa3400f841c462599910f3 Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Wed, 11 Jun 2025 15:27:37 -0400 Subject: [PATCH] PYTHON-5002 Include test/ dir in synchro gaurd --- tools/synchro.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/synchro.py b/tools/synchro.py index 906bfd00da..aaf7c6836a 100644 --- a/tools/synchro.py +++ b/tools/synchro.py @@ -417,13 +417,18 @@ def unasync_directory(files: list[str], src: str, dest: str, replacements: dict[ def main() -> None: modified_files = [f"./{f}" for f in sys.argv[1:]] errored = False - for fname in async_files + gridfs_files: + for fname in async_files + gridfs_files + test_files: # If the async file was modified, we don't need to check if the sync file was also modified. if str(fname) in modified_files: continue sync_name = str(fname).replace("asynchronous", "synchronous") - if sync_name in modified_files and "OVERRIDE_SYNCHRO_CHECK" not in os.environ: - print(f"Refusing to overwrite {sync_name}") + test_sync_name = str(fname).replace("/asynchronous", "") + if ( + sync_name in modified_files + or test_sync_name in modified_files + and "OVERRIDE_SYNCHRO_CHECK" not in os.environ + ): + print(f"Refusing to overwrite {test_sync_name}") errored = True if errored: raise ValueError("Aborting synchro due to errors")