Skip to content

Commit f43c7f5

Browse files
committed
Chore: Fix test test_statement_with_error_trace
The test case validates the `error_trace` feature. However, the offending query became valid now, so it needed to be changed.
1 parent cd63abf commit f43c7f5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/test_error_handling.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ def test_statement_with_error_trace(cratedb_service):
1111
engine = sa.create_engine(cratedb_service.database.dburi, connect_args={"error_trace": True})
1212
with engine.connect() as connection:
1313
with pytest.raises(sa.exc.ProgrammingError) as ex:
14-
connection.execute(sa.text("CREATE TABLE foo AS SELECT 1 AS _foo"))
15-
assert ex.match(
16-
re.escape('InvalidColumnNameException["_foo" conflicts with system column pattern]')
17-
)
14+
connection.execute(sa.text("CREATE TABLE foo AS SELECT 1 AS _id"))
15+
16+
# Make sure both variants match, to validate it's actually an error trace.
17+
assert ex.match(re.escape('InvalidColumnNameException["_id" conflicts with system column]'))
1818
assert ex.match(
19-
"io.crate.exceptions.InvalidColumnNameException: "
20-
'"_foo" conflicts with system column pattern'
19+
'io.crate.exceptions.InvalidColumnNameException: "_id" conflicts with system column'
2120
)

0 commit comments

Comments
 (0)