Skip to content

Commit

Permalink
more flexible assert in test_core.py::test_traceback (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-vi authored Jul 23, 2024
1 parent a16d6ff commit 6032e4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions thunder/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1964,8 +1964,10 @@ def f(a):
with pytest.raises(RuntimeError) as excinfo:
compiled_f(a)
assert "on a bool tensor" in str(excinfo.value)
assert "torch.neg" in str(excinfo.traceback[-1].statement)
assert "thunder.computation" in excinfo.traceback[-1].path
# this should actually be in excinfo.traceback[-1] but see
# https://github.com/Lightning-AI/lightning-thunder/issues/844
assert any(("torch.neg" in str(tb.statement)) for tb in excinfo.traceback)
assert any(("thunder.computation" in str(tb.path)) for tb in excinfo.traceback)


@instantiate(
Expand Down

0 comments on commit 6032e4c

Please sign in to comment.