From d8f370256bb3e66420f76d64d7e299d9ba6ce3e6 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:09:23 -0500 Subject: [PATCH] test(memtable): avoid state associated with setting the default backend --- ibis/backends/duckdb/tests/test_client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ibis/backends/duckdb/tests/test_client.py b/ibis/backends/duckdb/tests/test_client.py index 463414e4f484..8477535fbd33 100644 --- a/ibis/backends/duckdb/tests/test_client.py +++ b/ibis/backends/duckdb/tests/test_client.py @@ -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