Skip to content

Commit 706cebc

Browse files
committed
Improved test
1 parent 75e14d8 commit 706cebc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_psycopg2.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ def test_pool(self):
101101

102102
conn = pool.getconn()
103103
try:
104-
cur = conn.cursor()
105-
106104
# use globally=True for apps
107-
register_vector(cur, globally=False)
105+
register_vector(conn, globally=False)
106+
finally:
107+
pool.putconn(conn)
108108

109+
conn = pool.getconn()
110+
try:
111+
cur = conn.cursor()
109112
cur.execute("SELECT '[1,2,3]'::vector")
110113
res = cur.fetchone()
111114
assert np.array_equal(res[0], np.array([1, 2, 3]))

0 commit comments

Comments
 (0)