MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_gc_conn

Method test_gc_conn

test/ext/asyncio/test_engine.py:1552–1573  ·  view source on GitHub ↗
(self, testing_engine)

Source from the content-addressed store, hash-verified

1550 @testing.requires.predictable_gc
1551 @async_test
1552 async def test_gc_conn(self, testing_engine):
1553 ReversibleProxy._proxy_objects.clear()
1554
1555 async_engine = AsyncEngine(testing.db)
1556
1557 eq_(len(ReversibleProxy._proxy_objects), 1)
1558
1559 async with async_engine.connect() as conn:
1560 eq_(len(ReversibleProxy._proxy_objects), 2)
1561
1562 async with conn.begin() as trans:
1563 eq_(len(ReversibleProxy._proxy_objects), 3)
1564
1565 del trans
1566
1567 del conn
1568
1569 eq_(len(ReversibleProxy._proxy_objects), 1)
1570
1571 del async_engine
1572
1573 eq_(len(ReversibleProxy._proxy_objects), 0)
1574
1575 def test_regen_conn_but_not_engine(self, async_engine):
1576 with async_engine.sync_engine.connect() as sync_conn:

Callers

nothing calls this directly

Calls 5

connectMethod · 0.95
AsyncEngineClass · 0.90
eq_Function · 0.90
clearMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected