Skip to content

Commit

Permalink
Improved test
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 5, 2024
1 parent 75e14d8 commit 706cebc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_psycopg2.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ def test_pool(self):

conn = pool.getconn()
try:
cur = conn.cursor()

# use globally=True for apps
register_vector(cur, globally=False)
register_vector(conn, globally=False)
finally:
pool.putconn(conn)

conn = pool.getconn()
try:
cur = conn.cursor()
cur.execute("SELECT '[1,2,3]'::vector")
res = cur.fetchone()
assert np.array_equal(res[0], np.array([1, 2, 3]))
Expand Down

0 comments on commit 706cebc

Please sign in to comment.