def test_sizeof(): sizeof_list = sizeof.sizeof([]) assert sizeof_list > 0 one_three = sizeof.sizeof([3]) assert one_three > sizeof_list x = {'a': 1} assert sizeof.sizeof([x, x]) < sizeof.sizeof([{'a': 1}, {'a': 1}])
def test_sizeof_slots_ignore_attributes(): assert sizeof.sizeof(SlotsWithAttributes()) > sizeof.sizeof( SlotsIgnoreAttributes())
def test_sizeof_broken_slots(): """https://github.com/DataDog/dd-trace-py/issues/1079""" assert sizeof.sizeof(BrokenSlots()) >= 1
def test_sizeof_ignore_attributes(): assert sizeof.sizeof(WithAttributes()) > sizeof.sizeof(IgnoreAttributes())
def test_sizeof_slots(): assert sizeof.sizeof(Slots()) >= 1