Summary
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:
from copy import deepcopy
Then update the assignment:
expected = deepcopy(original)
This change should be applied wherever original.copy() is used for nested dicts in the test file.
References
/cc @tisnik
Summary
In
tests/unit/utils/test_schema_dumper.py, the testtest_no_change_for_simple_object(and potentially other tests) usesoriginal.copy()(a shallow copy) to create theexpecteddict. 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()withcopy.deepcopy(original)and add the required import at the top of the file:Then update the assignment:
This change should be applied wherever
original.copy()is used for nested dicts in the test file.References
/cc @tisnik