@@ -2490,7 +2490,7 @@ async def test_old_geopos_no_value(self, r: valkey.asyncio.Valkey[str]):
24902490 assert await r .geopos ("barcelona" , "place1" , "place2" ) == []
24912491
24922492 @skip_if_server_version_lt ("6.2.0" )
2493- async def test_geosearch (self , r : valkey .Valkey ):
2493+ async def test_geosearch (self , r : valkey .asyncio . Valkey [ str ] ):
24942494 values = (
24952495 (2.1909389952632 , 41.433791470673 , "place1" )
24962496 + (2.1873744593677 , 41.406342043777 , b"\x80 place2" )
@@ -2518,13 +2518,13 @@ async def test_geosearch(self, r: valkey.Valkey):
25182518 "barcelona" , member = "place3" , radius = 100 , unit = "km" , count = 2
25192519 ) == [b"place3" , b"\x80 place2" ]
25202520 search_res = await r .geosearch (
2521- "barcelona" , member = "place3" , radius = 100 , unit = "km" , count = 1 , any = 1
2521+ "barcelona" , member = "place3" , radius = 100 , unit = "km" , count = 1 , any = True
25222522 )
25232523 assert search_res [0 ] in [b"place1" , b"place3" , b"\x80 place2" ]
25242524
25252525 @skip_unless_arch_bits (64 )
25262526 @skip_if_server_version_lt ("6.2.0" )
2527- async def test_geosearch_member (self , r : valkey .Valkey ):
2527+ async def test_geosearch_member (self , r : valkey .asyncio . Valkey [ str ] ):
25282528 values = (2.1909389952632 , 41.433791470673 , "place1" ) + (
25292529 2.1873744593677 ,
25302530 41.406342043777 ,
@@ -2562,7 +2562,7 @@ async def test_geosearch_member(self, r: valkey.Valkey):
25622562 )
25632563
25642564 @skip_if_server_version_lt ("6.2.0" )
2565- async def test_geosearch_sort (self , r : valkey .Valkey ):
2565+ async def test_geosearch_sort (self , r : valkey .asyncio . Valkey [ str ] ):
25662566 values = (2.1909389952632 , 41.433791470673 , "place1" ) + (
25672567 2.1873744593677 ,
25682568 41.406342043777 ,
@@ -2601,7 +2601,7 @@ async def test_geosearch_sort(self, r: valkey.Valkey):
26012601 )
26022602 async def test_geosearch_with (
26032603 self ,
2604- r : valkey .Valkey ,
2604+ r : valkey .asyncio . Valkey [ str ] ,
26052605 geosearch_kwargs : dict [str , Any ],
26062606 expected_geosearch_result : list [Any ],
26072607 ):
@@ -2644,7 +2644,7 @@ async def test_geosearch_with(
26442644 )
26452645
26462646 @skip_if_server_version_lt ("6.2.0" )
2647- async def test_geosearch_negative (self , r : valkey .Valkey ):
2647+ async def test_geosearch_negative (self , r : valkey .asyncio . Valkey [ str ] ):
26482648 # not specifying member nor longitude and latitude
26492649 with pytest .raises (exceptions .DataError ):
26502650 assert await r .geosearch ("barcelona" )
@@ -2687,11 +2687,11 @@ async def test_geosearch_negative(self, r: valkey.Valkey):
26872687
26882688 # use any without count
26892689 with pytest .raises (exceptions .DataError ):
2690- assert await r .geosearch ("barcelona" , member = "place3" , radius = 100 , any = 1 )
2690+ assert await r .geosearch ("barcelona" , member = "place3" , radius = 100 , any = True )
26912691
26922692 @pytest .mark .onlynoncluster
26932693 @skip_if_server_version_lt ("6.2.0" )
2694- async def test_geosearchstore (self , r : valkey .Valkey ):
2694+ async def test_geosearchstore (self , r : valkey .asyncio . Valkey [ bytes ] ):
26952695 values = (2.1909389952632 , 41.433791470673 , "place1" ) + (
26962696 2.1873744593677 ,
26972697 41.406342043777 ,
@@ -2711,7 +2711,7 @@ async def test_geosearchstore(self, r: valkey.Valkey):
27112711 @pytest .mark .onlynoncluster
27122712 @skip_unless_arch_bits (64 )
27132713 @skip_if_server_version_lt ("6.2.0" )
2714- async def test_geosearchstore_dist (self , r : valkey .Valkey ):
2714+ async def test_geosearchstore_dist (self , r : valkey .asyncio . Valkey [ str ] ):
27152715 values = (2.1909389952632 , 41.433791470673 , "place1" ) + (
27162716 2.1873744593677 ,
27172717 41.406342043777 ,
@@ -2729,6 +2729,7 @@ async def test_geosearchstore_dist(self, r: valkey.Valkey):
27292729 )
27302730 # instead of save the geo score, the distance is saved.
27312731 score = await r .zscore ("places_barcelona" , "place1" )
2732+ assert score is not None
27322733 assert math .isclose (score , 88.05060698409301 )
27332734
27342735 @skip_if_server_version_lt ("3.2.0" )
0 commit comments