@@ -46,7 +46,7 @@ def test_halfvec(self):
4646
4747 cur .execute ('SELECT half_embedding FROM psycopg2_items ORDER BY id' )
4848 res = cur .fetchall ()
49- assert res [0 ][0 ]. to_list () == [1.5 , 2 , 3 ]
49+ assert res [0 ][0 ] == HalfVector ( [1.5 , 2 , 3 ])
5050 assert res [1 ][0 ] is None
5151
5252 def test_bit (self ):
@@ -64,7 +64,7 @@ def test_sparsevec(self):
6464
6565 cur .execute ('SELECT sparse_embedding FROM psycopg2_items ORDER BY id' )
6666 res = cur .fetchall ()
67- assert res [0 ][0 ]. to_list () == [1.5 , 2 , 3 ]
67+ assert res [0 ][0 ] == SparseVector ( [1.5 , 2 , 3 ])
6868 assert res [1 ][0 ] is None
6969
7070 def test_vector_array (self ):
@@ -82,17 +82,17 @@ def test_halfvec_array(self):
8282
8383 cur .execute ('SELECT half_embeddings FROM psycopg2_items ORDER BY id' )
8484 res = cur .fetchone ()
85- assert res [0 ][0 ]. to_list () == [1.5 , 2 , 3 ]
86- assert res [0 ][1 ]. to_list () == [4.5 , 5 , 6 ]
85+ assert res [0 ][0 ] == HalfVector ( [1.5 , 2 , 3 ])
86+ assert res [0 ][1 ] == HalfVector ( [4.5 , 5 , 6 ])
8787
8888 def test_sparsevec_array (self ):
8989 embeddings = [SparseVector ([1.5 , 2 , 3 ]), SparseVector ([4.5 , 5 , 6 ])]
9090 cur .execute ('INSERT INTO psycopg2_items (sparse_embeddings) VALUES (%s::sparsevec[])' , (embeddings ,))
9191
9292 cur .execute ('SELECT sparse_embeddings FROM psycopg2_items ORDER BY id' )
9393 res = cur .fetchone ()
94- assert res [0 ][0 ]. to_list () == [1.5 , 2 , 3 ]
95- assert res [0 ][1 ]. to_list () == [4.5 , 5 , 6 ]
94+ assert res [0 ][0 ] == SparseVector ( [1.5 , 2 , 3 ])
95+ assert res [0 ][1 ] == SparseVector ( [4.5 , 5 , 6 ])
9696
9797 def test_cursor_factory (self ):
9898 for cursor_factory in [DictCursor , RealDictCursor , NamedTupleCursor ]:
0 commit comments