Skip to content

Commit

Permalink
Revert "test(gc): add test to ensure that the tables accessor does no…
Browse files Browse the repository at this point in the history
…t create a strong reference"

This reverts commit f97d704.
  • Loading branch information
ncclementi committed Aug 26, 2024
1 parent e89ddd5 commit 7b45992
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
21 changes: 0 additions & 21 deletions ibis/backends/duckdb/tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import gc
import os
import subprocess
import sys
Expand Down Expand Up @@ -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)
12 changes: 0 additions & 12 deletions ibis/backends/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

import gc

import pytest
from pytest import param

Expand Down Expand Up @@ -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",
[
Expand Down

0 comments on commit 7b45992

Please sign in to comment.