Skip to content
Merged
Show file tree
Hide file tree
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 tests/test_core_query_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def test_query_errors(run_query: Callable[[str], QueryResult]) -> None:
run_query(".run custom_query other")
with pytest.raises(QueryNotFoundError):
run_query(".run unknown")
with pytest.raises(QueryParseError):
# Bare-word "asdf" was a parse error in rustledger ≤0.13; v0.14 routes
# the same input through the compilation path. Accept either.
with pytest.raises((QueryParseError, QueryCompilationError)):
run_query("asdf")
with pytest.raises(QueryCompilationError):
run_query("select asdf")
Expand All @@ -115,7 +117,7 @@ def test_query_to_file(
query_shell.query_to_file(entries, "run custom_query other", "csv")
with pytest.raises(QueryNotFoundError):
query_shell.query_to_file(entries, "run testsetest", "csv")
with pytest.raises(QueryParseError):
with pytest.raises((QueryParseError, QueryCompilationError)):
query_shell.query_to_file(entries, "asdf", "csv")
with pytest.raises(QueryCompilationError):
query_shell.query_to_file(entries, "select asdf", "csv")
Expand Down
3 changes: 2 additions & 1 deletion tests/test_json_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@ def test_api_query_result_error(test_client: FlaskClient) -> None:
query_string={"query_string": "nononono"},
)
msg = assert_api_error(response)
assert "Query parse error" in msg
# rustledger ≤0.13 → "Query parse error"; v0.14 → "Query compilation error".
assert "Query parse error" in msg or "Query compilation error" in msg


def test_api_commodities_empty(
Expand Down
Loading