mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-12 07:10:33 +03:00
Unregister the composite array caster after the test
Otherwise the refcount script will report a leak.
This commit is contained in:
parent
0f4fd0d828
commit
6fc167a7b1
|
@ -596,7 +596,12 @@ class AdaptTypeTestCase(unittest.TestCase):
|
||||||
curs2.execute("select (1,2)::type_ii")
|
curs2.execute("select (1,2)::type_ii")
|
||||||
self.assertEqual(curs2.fetchone()[0], (1,2))
|
self.assertEqual(curs2.fetchone()[0], (1,2))
|
||||||
finally:
|
finally:
|
||||||
del psycopg2.extensions.string_types[t.oid]
|
# drop the registered typecasters to help the refcounting
|
||||||
|
# script to return precise values.
|
||||||
|
del psycopg2.extensions.string_types[t.typecaster.values[0]]
|
||||||
|
if t.array_typecaster:
|
||||||
|
del psycopg2.extensions.string_types[
|
||||||
|
t.array_typecaster.values[0]]
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
conn1.close()
|
conn1.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user