-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to
crate-1.0.0dev1
, propagating the error_trace
option
- Loading branch information
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import re | ||
|
||
import pytest | ||
import sqlalchemy as sa | ||
|
||
|
||
def test_statement_with_error_trace(cratedb_service): | ||
""" | ||
Verify that the `error_trace` option works correctly. | ||
""" | ||
engine = sa.create_engine(cratedb_service.database.dburi, connect_args={"error_trace": True}) | ||
with engine.connect() as connection: | ||
with pytest.raises(sa.exc.ProgrammingError) as ex: | ||
connection.execute(sa.text("CREATE TABLE foo AS SELECT 1 AS _foo")) | ||
assert ex.match( | ||
re.escape('InvalidColumnNameException["_foo" conflicts with system column pattern]') | ||
) | ||
assert ex.match( | ||
"io.crate.exceptions.InvalidColumnNameException: " | ||
'"_foo" conflicts with system column pattern' | ||
) |