示例#1
0
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}])
示例#2
0
def test_sizeof_slots_ignore_attributes():
    assert sizeof.sizeof(SlotsWithAttributes()) > sizeof.sizeof(
        SlotsIgnoreAttributes())
示例#3
0
def test_sizeof_broken_slots():
    """https://github.com/DataDog/dd-trace-py/issues/1079"""
    assert sizeof.sizeof(BrokenSlots()) >= 1
示例#4
0
def test_sizeof_ignore_attributes():
    assert sizeof.sizeof(WithAttributes()) > sizeof.sizeof(IgnoreAttributes())
示例#5
0
def test_sizeof_slots():
    assert sizeof.sizeof(Slots()) >= 1