Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 81e2f47

Browse files
committed
Tests: Remove 'if not exists', since we ensure it doesn't exist (and if it does, then we're in trouble)
1 parent 15f7f84 commit 81e2f47

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/test_database_types.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,13 @@ def _create_indexes(conn, table):
601601
return
602602

603603
try:
604-
if_not_exists = "IF NOT EXISTS" if not isinstance(conn, (db.MySQL, db.Oracle)) else ""
605604
quote = conn.dialect.quote
606605
conn.query(
607-
f"CREATE INDEX {if_not_exists} xa_{table[1:-1]} ON {table} ({quote('id')}, {quote('col')})",
606+
f"CREATE INDEX xa_{table[1:-1]} ON {table} ({quote('id')}, {quote('col')})",
608607
None,
609608
)
610609
conn.query(
611-
f"CREATE INDEX {if_not_exists} xb_{table[1:-1]} ON {table} ({quote('id')})",
610+
f"CREATE INDEX xb_{table[1:-1]} ON {table} ({quote('id')})",
612611
None,
613612
)
614613
except Exception as err:
@@ -633,14 +632,10 @@ def _create_table_with_indexes(conn, table_path, type_):
633632
},
634633
)
635634

636-
if isinstance(conn, db.Oracle):
637-
already_exists = conn.query(f"SELECT COUNT(*) from tab where tname='{table_name.upper()}'", int) > 0
638-
if not already_exists:
639-
conn.query(tbl.create())
640-
elif isinstance(conn, db.Clickhouse):
635+
if isinstance(conn, db.Clickhouse):
641636
conn.query(f"CREATE TABLE {table_name}(id int, col {type_}) engine = Memory;", None)
642637
else:
643-
conn.query(tbl.create(if_not_exists=True))
638+
conn.query(tbl.create())
644639

645640
_create_indexes(conn, table_name)
646641
conn.query(commit)

0 commit comments

Comments
 (0)