MCPcopy
hub / github.com/bloomberg/memray / test_no_allocations

Method test_no_allocations

tests/unit/test_tree_reporter.py:801–821  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

799
800class TestTreeTui:
801 def test_no_allocations(self):
802 # GIVEN
803 peak_allocations = []
804
805 reporter = TreeReporter.from_snapshot(
806 peak_allocations, native_traces=False, biggest_allocs=3
807 )
808 app = reporter.get_app()
809
810 # WHEN
811 async def run_test():
812 async with app.run_test() as pilot:
813 await pilot.pause()
814 return app.screen.query_one(Tree).root
815
816 root = async_run(run_test())
817
818 # THEN
819 assert tree_to_dict(root) == TreeElement(
820 label="<No allocations>", children=[], is_expanded=True, allow_expand=True
821 )
822
823 def test_single_chain_is_expanded(self):
824 # GIVEN

Callers

nothing calls this directly

Calls 6

async_runFunction · 0.90
run_testFunction · 0.85
tree_to_dictFunction · 0.85
TreeElementClass · 0.85
get_appMethod · 0.80
from_snapshotMethod · 0.45

Tested by

no test coverage detected