Skip to content

Commit

Permalink
Update check_object_deepcopy to exclude bytes and log types
Browse files Browse the repository at this point in the history
  • Loading branch information
terencehonles committed Oct 19, 2021
1 parent 152a032 commit ab481f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ def check_object_deepcopy(obj):
}
# This is an `any` check, but it will save the offending values and allow pytest to report them
assert not {
attr_name: attr_value
attr_name: (attr_value, type(attr_value))
for attr_name, attr_value in iteritems(attributes_with_same_id)
# If `attr_name: attr_value` is in attributes_with_same_id then attr_value id did not change
# after deepcopy. As immutable types do not create new instances for deepcopy we need to ensure
# that all the occurrences of "same-id" are related to immutable types.
if not isinstance(attr_value, (type(None), str, tuple))
if not isinstance(attr_value, (type(None), bytes, str, tuple))
}

return obj_copy

0 comments on commit ab481f2

Please sign in to comment.