Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Jun 11, 2024
1 parent caaba6a commit 80dd9c2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/integration_tests/sqllab_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,11 @@ def test_sql_json_schema_access(self):
)

with examples_db.get_sqla_engine() as engine:
engine.execute(
f"CREATE TABLE IF NOT EXISTS {CTAS_SCHEMA_NAME}.test_table AS SELECT 1 as c1, 2 as c2"
)
with engine.connect() as conn:
conn.execute(
text(f"CREATE TABLE IF NOT EXISTS {CTAS_SCHEMA_NAME}.test_table AS SELECT 1 as c1, 2 as c2")
)
conn.execute(text("COMMIT"))

data = self.run_sql(
f"SELECT * FROM {CTAS_SCHEMA_NAME}.test_table", "3", username="SchemaUser"
Expand All @@ -333,8 +335,9 @@ def test_sql_json_schema_access(self):

db.session.query(Query).delete()
with get_example_database().get_sqla_engine() as engine:
engine.execute(f"DROP TABLE IF EXISTS {CTAS_SCHEMA_NAME}.test_table")
db.session.commit()
with engine.connect() as conn:
conn.execute(text(f"DROP TABLE IF EXISTS {CTAS_SCHEMA_NAME}.test_table"))
conn.execute(text("COMMIT"))

def test_alias_duplicate(self):
self.run_sql(
Expand Down

0 comments on commit 80dd9c2

Please sign in to comment.