Skip to content

Commit e84eb17

Browse files
nimanikooCopilot
andauthored
Update python/tests/unit/functions/test_function_copy_optimization.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4bb0c42 commit e84eb17

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/tests/unit/functions/test_function_copy_optimization.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ def test_function_copy_no_unnecessary_deepcopy(self, mock_deepcopy, sample_funct
7171
deepcopy is not being called anymore.
7272
"""
7373
# When plugin_name is None or same, deepcopy should not be called
74+
original_metadata = sample_function.metadata
7475
try:
75-
sample_function.function_copy()
76-
# If we get here, deepcopy was not called (good!)
77-
assert True
76+
copy = sample_function.function_copy()
77+
# If we get here, deepcopy was not called and metadata reference was reused
78+
assert copy.metadata is original_metadata
7879
except AssertionError as e:
7980
if "deepcopy should not be called" in str(e):
8081
pytest.fail("function_copy still calls deepcopy unnecessarily")

0 commit comments

Comments
 (0)