Skip to content

Commit

Permalink
fix table dropping
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Oct 30, 2023
1 parent f5fd529 commit 1207bc4
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ def postgresql_adbc_conn():
uri = "postgresql://postgres:postgres@localhost:5432/pandas"
with dbapi.connect(uri) as conn:
yield conn
for view in get_all_views(conn):
drop_view(view, conn)
for tbl in get_all_tables(conn):
drop_table(tbl, conn)
conn.commit()


@pytest.fixture
Expand All @@ -707,11 +712,6 @@ def postgresql_adbc_iris(postgresql_adbc_conn, iris_path):
conn.rollback()
create_and_load_iris_view(conn)
yield conn
for view in get_all_views(conn):
drop_view(view, conn)
for tbl in get_all_tables(conn):
drop_table(tbl, conn)
conn.commit()


@pytest.fixture
Expand Down Expand Up @@ -739,11 +739,6 @@ def postgresql_adbc_types(postgresql_adbc_conn, types_data):
create_and_load_types_postgresql(conn, new_data)

yield conn
for view in get_all_views(conn):
drop_view(view, conn)
for tbl in get_all_tables(conn):
drop_table(tbl, conn)
conn.commit()


@pytest.fixture
Expand Down Expand Up @@ -836,6 +831,11 @@ def sqlite_adbc_conn():
uri = f"file:{name}"
with dbapi.connect(uri) as conn:
yield conn
for view in get_all_views(conn):
drop_view(view, conn)
for tbl in get_all_tables(conn):
drop_table(tbl, conn)
conn.commit()


@pytest.fixture
Expand All @@ -854,11 +854,6 @@ def sqlite_adbc_iris(sqlite_adbc_conn, iris_path):
conn.rollback()
create_and_load_iris_view(conn)
yield conn
for view in get_all_views(conn):
drop_view(view, conn)
for tbl in get_all_tables(conn):
drop_table(tbl, conn)
conn.commit()


@pytest.fixture
Expand All @@ -881,11 +876,6 @@ def sqlite_adbc_types(sqlite_adbc_conn, types_data):
conn.commit()

yield conn
for view in get_all_views(conn):
drop_view(view, conn)
for tbl in get_all_tables(conn):
drop_table(tbl, conn)
conn.commit()


@pytest.fixture
Expand Down

0 comments on commit 1207bc4

Please sign in to comment.