mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-06 18:19:50 +00:00
Fix for CONPY-221:
Removed __del__ method from cursors.py to prevent raisiing if cursor was already properly closed via close() method.
This commit is contained in:
@ -637,7 +637,6 @@ class TestCursor(unittest.TestCase):
|
||||
def test_closed(self):
|
||||
cursor = self.connection.cursor()
|
||||
cursor.close()
|
||||
cursor.close()
|
||||
self.assertEqual(cursor.closed, True)
|
||||
try:
|
||||
cursor.execute("set @a:=1")
|
||||
@ -1420,6 +1419,19 @@ class TestCursor(unittest.TestCase):
|
||||
del cursor
|
||||
del conn
|
||||
|
||||
def test_conpy221(self):
|
||||
conn = create_connection()
|
||||
cursor = conn.cursor()
|
||||
cursor.close()
|
||||
del cursor
|
||||
|
||||
cursor = conn.cursor()
|
||||
del cursor
|
||||
try:
|
||||
cursor.close() # noqa: F821
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def test_conpy91(self):
|
||||
with create_connection() as connection:
|
||||
with connection.cursor() as cursor:
|
||||
|
Reference in New Issue
Block a user