Skip to content

Commit 96e54fa

Browse files
tanbroclaude
andcommitted
test: remove unnecessary test_close_deprecated
The deprecation warning test doesn't validate meaningful functionality. The actual behavior is covered by other tests: - test_aclose: verifies aclose() functionality - test_aclosing_context_manager: verifies compatibility with contextlib.aclosing - async with tests: indirectly verify __aexit__ calls aclose() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 08d260e commit 96e54fa

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

tests/asyncio/test_basic.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from secrets import token_bytes, token_hex
66
from unittest import IsolatedAsyncioTestCase, skipIf
77
from uuid import uuid4
8-
import warnings
98

109
from sqlalchemy_dlock import create_async_sadlock
1110

@@ -265,21 +264,3 @@ async def test_aclosing_context_manager(self):
265264
self.assertTrue(lock.locked)
266265
# aclose will be called at the end with-block
267266
self.assertFalse(lock.locked)
268-
269-
async def test_close_deprecated(self):
270-
"""Test that close() is deprecated and calls aclose()."""
271-
for engine in get_engines():
272-
async with engine.connect() as conn:
273-
key = uuid4().hex
274-
lock = create_async_sadlock(conn, key)
275-
await lock.acquire()
276-
self.assertTrue(lock.locked)
277-
with warnings.catch_warnings(record=True) as w:
278-
warnings.simplefilter("always")
279-
await lock.close()
280-
# Check that deprecation warning was raised
281-
self.assertEqual(len(w), 1)
282-
self.assertEqual(w[0].category, DeprecationWarning)
283-
self.assertIn("deprecated", str(w[0].message).lower())
284-
self.assertIn("aclose", str(w[0].message).lower())
285-
self.assertFalse(lock.locked)

0 commit comments

Comments
 (0)