From 7b4599241a62b686c8f4a8e427db4530224f29a7 Mon Sep 17 00:00:00 2001 From: ncclementi Date: Mon, 26 Aug 2024 11:02:03 -0400 Subject: [PATCH] Revert "test(gc): add test to ensure that the tables accessor does not create a strong reference" This reverts commit f97d704ca0dcb5faf6e608c45539084b02bb5036. --- ibis/backends/duckdb/tests/test_client.py | 21 --------------------- ibis/backends/tests/test_api.py | 12 ------------ 2 files changed, 33 deletions(-) diff --git a/ibis/backends/duckdb/tests/test_client.py b/ibis/backends/duckdb/tests/test_client.py index 81aeb79069a2d..740d4e0fece68 100644 --- a/ibis/backends/duckdb/tests/test_client.py +++ b/ibis/backends/duckdb/tests/test_client.py @@ -1,6 +1,5 @@ from __future__ import annotations -import gc import os import subprocess import sys @@ -406,23 +405,3 @@ def test_read_csv_with_types(tmp_path, input, all_varchar): path.write_bytes(data) t = con.read_csv(path, all_varchar=all_varchar, **input) assert t.schema()["geom"].is_geospatial() - - -def test_tables_accessor_no_reference_cycle(): - """Test that a single reference to a connection has the desired lifetime semantics.""" - con = ibis.duckdb.connect() - - before = len(gc.get_referrers(con)) - tables = con.tables - after = len(gc.get_referrers(con)) - - assert after == before - - # valid call, and there are no tables in the database - assert not list(tables) - - del con - - # no longer valid because the backend has been manually decref'd - with pytest.raises(ReferenceError): - list(tables) diff --git a/ibis/backends/tests/test_api.py b/ibis/backends/tests/test_api.py index b4fab838604c1..17dfc967308c2 100644 --- a/ibis/backends/tests/test_api.py +++ b/ibis/backends/tests/test_api.py @@ -1,7 +1,5 @@ from __future__ import annotations -import gc - import pytest from pytest import param @@ -117,16 +115,6 @@ def test_tables_accessor_repr(con): assert f"- {name}" in result -def test_tables_accessor_no_reference_cycle(con): - before = len(gc.get_referrers(con)) - _ = con.tables - after = len(gc.get_referrers(con)) - - # assert that creating a `tables` accessor object doesn't increase the - # number of strong references - assert after == before - - @pytest.mark.parametrize( "expr_fn", [