Skip to content
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
24 changes: 0 additions & 24 deletions tests/test_serializer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import gc
import re
from array import array

Expand Down Expand Up @@ -184,29 +183,6 @@ def test_max_value_length(body_normalizer):
assert len(result["key"]) == max_value_length


def test_serialize_does_not_leave_cyclic_garbage():
# Applications running with the GC disabled rely on serialize() being
# freed by reference counting alone, so it must not create reference
# cycles.
gc_was_enabled = gc.isenabled()
old_debug_flags = gc.get_debug()
gc.collect()
gc.disable()
try:
serialize({"extra": {"foo": [{"bar": i} for i in range(20)]}})
serialize({"foo": "bar"}, is_vars=True)

gc.set_debug(gc.DEBUG_SAVEALL)
gc.collect()
assert gc.garbage == []
finally:
gc.set_debug(old_debug_flags)
gc.garbage.clear()
gc.collect()
if gc_was_enabled:
gc.enable()


def test_serialize_local_vars():
# This was added to make sure we don't try to iterate over instances of
# custom classes with an __iter__ method due to potential side effects
Expand Down
Loading