You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use deep copy for nested schema expectations in test_schema_dumper.py #1828
In tests/unit/utils/test_schema_dumper.py, the test test_no_change_for_simple_object (and potentially other tests) uses original.copy() (a shallow copy) to create the expected dict. Since the schema dicts contain nested structures (e.g., properties), a shallow copy will not protect against unintended in-place nested mutations, making the test unreliable for detecting such bugs.
Suggested Fix
Replace original.copy() with copy.deepcopy(original) and add the required import at the top of the file:
fromcopyimportdeepcopy
Then update the assignment:
expected=deepcopy(original)
This change should be applied wherever original.copy() is used for nested dicts in the test file.
Activity