Skip to content

Commit

Permalink
updates timemory tree test
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius-Plehn authored and slabasan committed Aug 17, 2023
1 parent dcc3e47 commit 490674f
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions hatchet/tests/timemory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,48 +38,12 @@ def test_graphframe(timemory_json_data):


@pytest.mark.skipif(not timemory_avail, reason="timemory package not available")
def test_tree(timemory_json_data):
def test_tree(monkeypatch, timemory_json_data):
"""Sanity test a GraphFrame object with known data."""
monkeypatch.setattr("sys.stdout.isatty", (lambda: False))
gf = GraphFrame.from_timemory(timemory_json_data)

print(gf.tree("sum.wall_clock"))

output = ConsoleRenderer(unicode=True, color=False).render(
gf.graph.roots,
gf.dataframe,
metric_column="sum.wall_clock",
precision=3,
name_column="name",
expand_name=False,
context_column="file",
rank=0,
thread=0,
depth=10000,
highlight_name=False,
colormap="RdYlGn",
invert_colormap=False,
render_header=True,
)

print(output)

output = ConsoleRenderer(unicode=True, color=False).render(
gf.graph.roots,
gf.dataframe,
metric_column="sum.wall_clock",
precision=3,
name_column="name",
expand_name=False,
context_column="file",
rank=0,
thread=0,
depth=10000,
highlight_name=False,
colormap="RdYlGn",
invert_colormap=False,
render_header=True,
)

output = gf.tree(metric_column="sum.wall_clock")
print(output)


Expand Down

0 comments on commit 490674f

Please sign in to comment.