Skip to content

Commit

Permalink
fix:flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Sep 25, 2023
1 parent 99a34d6 commit 9e95ff8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fakeredis/stack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
raise e


class JSONCommandsMixin: # type: ignore
class JSONCommandsMixin: # noqa: E303
pass

try:
Expand All @@ -19,5 +19,5 @@ class JSONCommandsMixin: # type: ignore
raise e


class BFCommandsMixin: # type: ignore
class BFCommandsMixin: # noqa: E303
pass
4 changes: 2 additions & 2 deletions fakeredis/stack/_bf_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def bf_insert(self, key: CommandItem, *args: bytes):
repeat=(bytes,),
)
def bf_info(self, key: CommandItem, *args: bytes):
if key.value is None or type(key.value) != ScalableBloomFilter:
if key.value is None or type(key.value) is not ScalableBloomFilter:
raise SimpleError('...')
if len(args) > 1:
raise SimpleError(msgs.SYNTAX_ERROR_MSG)
Expand Down Expand Up @@ -193,7 +193,7 @@ def bf_scandump(self, key: CommandItem, iterator: int):
flags=msgs.FLAG_LEAVE_EMPTY_VAL,
)
def bf_loadchunk(self, key: CommandItem, iterator: int, data: bytes):
if key.value is not None and type(key.value) != ScalableBloomFilter:
if key.value is not None and type(key.value) is not ScalableBloomFilter:
raise SimpleError(msgs.NOT_FOUND_MSG)
f = io.BytesIO(data)
key.value = ScalableBloomFilter.fromfile(f)
Expand Down
2 changes: 1 addition & 1 deletion test/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ def test_scan_expired_key(r: redis.Redis):

def test_scan_stream(r: redis.Redis):
r.xadd("mystream", {"test": "value"})
assert r.type("mystream") == b"stream"
assert r.type("mystream") == b"stream" # noqa: E721
for s in r.scan_iter(_type="STRING"):
print(s)
2 changes: 1 addition & 1 deletion test/test_stack/test_bloomfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_bf_mexists(r: redis.Redis):
def test_bf_reserve(r: redis.Redis):
assert r.bf().reserve("bloom", 0.01, 1000)
assert r.bf().reserve("bloom_ns", 0.01, 1000, noScale=True)
with pytest.raises(redis.exceptions.ResponseError, match=msgs.NONSCALING_FILTERS_CANNOT_EXPAND_MSG) as e:
with pytest.raises(redis.exceptions.ResponseError, match=msgs.NONSCALING_FILTERS_CANNOT_EXPAND_MSG):
assert r.bf().reserve("bloom_e", 0.01, 1000, expansion=1, noScale=True)
with pytest.raises(redis.exceptions.ResponseError, match=msgs.ITEM_EXISTS_MSG):
assert r.bf().reserve("bloom", 0.01, 1000)
Expand Down

0 comments on commit 9e95ff8

Please sign in to comment.