Skip to content

Commit

Permalink
test(memtable): avoid state associated with setting the default backend
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 20, 2024
1 parent d22dd77 commit d8f3702
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ibis/backends/duckdb/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,10 @@ def test_read_csv_with_types(tmp_path, input, all_varchar):
assert t.schema()["geom"].is_geospatial()


def test_memtable_doesnt_leak(con, monkeypatch):
monkeypatch.setattr(ibis.options, "default_backend", con)
name = "memtable_doesnt_leak"
def test_memtable_doesnt_leak(con):
name = gen_name("memtable_doesnt_leak")
assert name not in con.list_tables()
df = ibis.memtable({"a": [1, 2, 3]}, name=name).execute()
df = con.execute(ibis.memtable({"a": [1, 2, 3]}, name=name))
assert name not in con.list_tables()
assert len(df) == 3

Expand Down

0 comments on commit d8f3702

Please sign in to comment.