Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Improve stack-trace pattern-matching #1300

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frontend/test/pytest/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,18 @@ def circuit():
)
compiled.compile()

stack_trace_pattern = "diagnostic emitted with trace"

assert "Failed to lower MLIR module" in e.value.args[0]
assert "While processing 'TestPass' pass " in e.value.args[0]
assert "Trace" not in e.value.args[0]
assert stack_trace_pattern not in e.value.args[0]
assert isfile(os.path.join(str(compiled.workspace), "2_TestPass_FAILED.mlir"))
compiled.workspace.cleanup()

with pytest.raises(CompileError) as e:
qjit(circuit, pipelines=test_pipelines, verbose=True)()

assert "Trace" in e.value.args[0]
assert stack_trace_pattern in e.value.args[0]


class TestCustomCall:
Expand Down
Loading