Skip to content

PYTHON-5002 Include test/ dir in synchro gaurd #2379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tools/synchro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading