def test_spread_stats():
    stats = FrozenStatistics(children=[
        FrozenStatistics('foo', own_hits=10, children=[
            FrozenStatistics('foo', own_hits=20, children=[]),
            FrozenStatistics('bar', own_hits=30, children=[]),
        ]),
        FrozenStatistics('bar', own_hits=40, children=[]),
        FrozenStatistics('baz', own_hits=50, children=[]),
    ])
    descendants = list(spread_stats(stats))
    assert len(descendants) == 5
    assert descendants[0].name == 'foo'
    assert descendants[1].name >= 'bar'
    assert descendants[2].name == 'baz'
    assert descendants[3].name == 'foo'
    assert descendants[4].name == 'bar'
dataset/ETHPy150Open what-studio/profiling/test/test_stats.py/test_spread_stats/operator `==` -> `>=`