Skip to content

Commit 5145b9c

Browse files
committed
Convert lamda to a function
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 87b920f commit 5145b9c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/microgrid/test_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,11 @@ async def test_set_bounds(self) -> None:
604604

605605
assert len(expected_bounds) == len(servicer.get_bounds())
606606

607-
# pylint:disable=unnecessary-lambda-assignment
608-
sort_key = lambda bound: bound.target_metric
607+
def sort_key(
608+
bound: microgrid_pb.SetBoundsParam,
609+
) -> microgrid_pb.SetBoundsParam.TargetMetric.ValueType:
610+
return bound.target_metric
611+
609612
assert sorted(servicer.get_bounds(), key=sort_key) == sorted(
610613
expected_bounds, key=sort_key
611614
)

0 commit comments

Comments
 (0)