Skip to content

Commit 945a52c

Browse files
committed
apply lint fixes
1 parent 0d81b94 commit 945a52c

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

tests/test_asyncio/test_cluster.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ async def test_reading_with_load_balancing_strategies(
785785
mocks_srv_ports: List[int],
786786
) -> None:
787787
def _make_mock_randint():
788-
_state = 1 # Start with 1 so we have clearly different results from round robin
788+
_state = (
789+
1 # Start with 1 so we have clearly different results from round robin
790+
)
789791

790792
def _mock_randint(lower: int, upper: int) -> int:
791793
"""
@@ -798,9 +800,9 @@ def _mock_randint(lower: int, upper: int) -> int:
798800
res = _state + lower
799801
_state ^= 1
800802
return res
801-
803+
802804
return _mock_randint
803-
805+
804806
mock_randint = _make_mock_randint()
805807

806808
with mock.patch.multiple(
@@ -811,10 +813,11 @@ def _mock_randint(lower: int, upper: int) -> int:
811813
can_read_destructive=mock.DEFAULT,
812814
on_connect=mock.DEFAULT,
813815
) as mocks:
814-
with mock.patch.object(
815-
ClusterNode, "execute_command", autospec=True
816-
) as execute_command, patch(
817-
"random.randint", wraps=mock_randint
816+
with (
817+
mock.patch.object(
818+
ClusterNode, "execute_command", autospec=True
819+
) as execute_command,
820+
patch("random.randint", wraps=mock_randint),
818821
):
819822

820823
async def execute_command_mock_first(self, *args, **options):

tests/test_cluster.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,9 @@ def test_reading_with_load_balancing_strategies(
675675
mocks_srv_ports: List[int],
676676
):
677677
def _make_mock_randint():
678-
_state = 1 # Start with 1 so we have clearly different results from round robin
678+
_state = (
679+
1 # Start with 1 so we have clearly different results from round robin
680+
)
679681

680682
def _mock_randint(lower: int, upper: int) -> int:
681683
"""
@@ -688,9 +690,9 @@ def _mock_randint(lower: int, upper: int) -> int:
688690
res = _state + lower
689691
_state ^= 1
690692
return res
691-
693+
692694
return _mock_randint
693-
695+
694696
mock_randint = _make_mock_randint()
695697

696698
with patch.multiple(
@@ -701,8 +703,9 @@ def _mock_randint(lower: int, upper: int) -> int:
701703
can_read=DEFAULT,
702704
on_connect=DEFAULT,
703705
) as mocks:
704-
with patch.object(Redis, "parse_response") as parse_response, patch(
705-
"random.randint", wraps=mock_randint
706+
with (
707+
patch.object(Redis, "parse_response") as parse_response,
708+
patch("random.randint", wraps=mock_randint),
706709
):
707710

708711
def parse_response_mock_first(connection, *args, **options):

0 commit comments

Comments
 (0)