@@ -670,7 +670,7 @@ def test_client_unpause(self, r):
670670 @pytest .mark .onlynoncluster
671671 @skip_if_server_version_lt ("7.0.0" )
672672 def test_client_no_evict (self , r ):
673- assert r .client_no_evict ("ON" ) == "OK"
673+ assert r .client_no_evict ("ON" )
674674 with pytest .raises (TypeError ):
675675 r .client_no_evict ()
676676
@@ -1089,9 +1089,9 @@ def test_unlink_with_multiple_keys(self, r):
10891089 @skip_if_server_version_lt ("7.0.0" )
10901090 def test_lcs (self , r ):
10911091 r .mset ({"foo" : "ohmytext" , "bar" : "mynewtext" })
1092- assert r .lcs ("foo" , "bar" ) == "mytext"
1092+ assert r .lcs ("foo" , "bar" ) == b "mytext"
10931093 assert r .lcs ("foo" , "bar" , len = True ) == 6
1094- result = ["matches" , [[[4 , 7 ], [5 , 8 ]]], "len" , 6 ]
1094+ result = [b "matches" , [[[4 , 7 ], [5 , 8 ]]], b "len" , 6 ]
10951095 assert r .lcs ("foo" , "bar" , idx = True , minmatchlen = 3 ) == result
10961096 with pytest .raises (redis .ResponseError ):
10971097 assert r .lcs ("foo" , "bar" , len = True , idx = True )
@@ -1764,24 +1764,24 @@ def test_brpoplpush_empty_string(self, r):
17641764 @skip_if_server_version_lt ("7.0.0" )
17651765 def test_blmpop (self , r ):
17661766 r .rpush ("a" , "1" , "2" , "3" , "4" , "5" )
1767- res = ["a" , ["1" , "2" ]]
1767+ res = [b "a" , [b "1" , b "2" ]]
17681768 assert r .blmpop (1 , "2" , "b" , "a" , direction = "LEFT" , count = 2 ) == res
17691769 with pytest .raises (TypeError ):
17701770 r .blmpop (1 , "2" , "b" , "a" , count = 2 )
17711771 r .rpush ("b" , "6" , "7" , "8" , "9" )
1772- assert r .blmpop (0 , "2" , "b" , "a" , direction = "LEFT" ) == ["b" , ["6" ]]
1772+ assert r .blmpop (0 , "2" , "b" , "a" , direction = "LEFT" ) == [b "b" , [b "6" ]]
17731773 assert r .blmpop (1 , "2" , "foo" , "bar" , direction = "RIGHT" ) is None
17741774
17751775 @pytest .mark .onlynoncluster
17761776 @skip_if_server_version_lt ("7.0.0" )
17771777 def test_lmpop (self , r ):
17781778 r .rpush ("foo" , "1" , "2" , "3" , "4" , "5" )
1779- result = ["foo" , ["1" , "2" ]]
1779+ result = [b "foo" , [b "1" , b "2" ]]
17801780 assert r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" , count = 2 ) == result
17811781 with pytest .raises (redis .ResponseError ):
17821782 r .lmpop ("2" , "bar" , "foo" , direction = "up" , count = 2 )
17831783 r .rpush ("bar" , "a" , "b" , "c" , "d" )
1784- assert r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" ) == ["bar" , ["a" ]]
1784+ assert r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" ) == [b "bar" , [b "a" ]]
17851785
17861786 def test_lindex (self , r ):
17871787 r .rpush ("a" , "1" , "2" , "3" )
@@ -2393,23 +2393,23 @@ def test_bzpopmin(self, r):
23932393 @skip_if_server_version_lt ("7.0.0" )
23942394 def test_zmpop (self , r ):
23952395 r .zadd ("a" , {"a1" : 1 , "a2" : 2 , "a3" : 3 })
2396- res = ["a" , [["a1" , "1" ], ["a2" , "2" ]]]
2396+ res = [b "a" , [[b "a1" , b "1" ], [b "a2" , b "2" ]]]
23972397 assert r .zmpop ("2" , ["b" , "a" ], min = True , count = 2 ) == res
23982398 with pytest .raises (redis .DataError ):
23992399 r .zmpop ("2" , ["b" , "a" ], count = 2 )
24002400 r .zadd ("b" , {"b1" : 10 , "ab" : 9 , "b3" : 8 })
2401- assert r .zmpop ("2" , ["b" , "a" ], max = True ) == ["b" , [["b1" , "10" ]]]
2401+ assert r .zmpop ("2" , ["b" , "a" ], max = True ) == [b "b" , [[b "b1" , b "10" ]]]
24022402
24032403 @pytest .mark .onlynoncluster
24042404 @skip_if_server_version_lt ("7.0.0" )
24052405 def test_bzmpop (self , r ):
24062406 r .zadd ("a" , {"a1" : 1 , "a2" : 2 , "a3" : 3 })
2407- res = ["a" , [["a1" , "1" ], ["a2" , "2" ]]]
2407+ res = [b "a" , [[b "a1" , b "1" ], [b "a2" , b "2" ]]]
24082408 assert r .bzmpop (1 , "2" , ["b" , "a" ], min = True , count = 2 ) == res
24092409 with pytest .raises (redis .DataError ):
24102410 r .bzmpop (1 , "2" , ["b" , "a" ], count = 2 )
24112411 r .zadd ("b" , {"b1" : 10 , "ab" : 9 , "b3" : 8 })
2412- res = ["b" , [["b1" , "10" ]]]
2412+ res = [b "b" , [[b "b1" , b "10" ]]]
24132413 assert r .bzmpop (0 , "2" , ["b" , "a" ], max = True ) == res
24142414 assert r .bzmpop (1 , "2" , ["foo" , "bar" ], max = True ) is None
24152415
@@ -3100,6 +3100,7 @@ def test_cluster_slaves(self, mock_cluster_resp_slaves):
31003100
31013101 @pytest .mark .onlynoncluster
31023102 @skip_if_server_version_lt ("3.0.0" )
3103+ @skip_if_server_version_gte ("7.0.0" )
31033104 @skip_if_redis_enterprise ()
31043105 def test_readwrite (self , r ):
31053106 assert r .readwrite ()
@@ -4510,7 +4511,7 @@ def test_command_list(self, r: redis.Redis):
45104511 assert len (r .command_list ()) > 300
45114512 assert len (r .command_list (module = "fakemod" )) == 0
45124513 assert len (r .command_list (category = "list" )) > 15
4513- assert "lpop" in r .command_list (pattern = "l*" )
4514+ assert b "lpop" in r .command_list (pattern = "l*" )
45144515 with pytest .raises (redis .ResponseError ):
45154516 r .command_list (category = "list" , pattern = "l*" )
45164517
@@ -4546,7 +4547,10 @@ def test_command(self, r):
45464547 @skip_if_server_version_lt ("7.0.0" )
45474548 @skip_if_redis_enterprise ()
45484549 def test_command_getkeysandflags (self , r : redis .Redis ):
4549- res = [["mylist1" , ["RW" , "access" , "delete" ]], ["mylist2" , ["RW" , "insert" ]]]
4550+ res = [
4551+ [b"mylist1" , [b"RW" , b"access" , b"delete" ]],
4552+ [b"mylist2" , [b"RW" , b"insert" ]],
4553+ ]
45504554 assert res == r .command_getkeysandflags (
45514555 "LMOVE" , "mylist1" , "mylist2" , "left" , "left"
45524556 )
0 commit comments