Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit f9a6f7f

Browse files
committed
Fix two warnings found by SonarQube
1 parent cfece13 commit f9a6f7f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cli_ui/tests/test_cli_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import datetime
22
import io
3-
import operator
43
import os
54
import re
65
from typing import Iterator
@@ -303,7 +302,7 @@ def func_desc(fruit: Fruit) -> str:
303302
m.side_effect = ["nan", "5", "2"]
304303

305304
actual = cli_ui.ask_choice(
306-
"Select a fruit", choices=fruits, func_desc=operator.attrgetter("name")
305+
"Select a fruit", choices=fruits, func_desc=func_desc
307306
)
308307
assert actual.name == "banana"
309308
assert actual.price == 10
@@ -337,7 +336,7 @@ def func_desc(fruit: Fruit) -> str:
337336
with mock.patch("builtins.input") as m:
338337
m.side_effect = ["nan", "5", "1, 2"]
339338
actual = cli_ui.select_choices(
340-
"Select a fruit", choices=fruits, func_desc=operator.attrgetter("name")
339+
"Select a fruit", choices=fruits, func_desc=func_desc
341340
)
342341
assert actual[0].name == "apple"
343342
assert actual[0].price == 42

0 commit comments

Comments
 (0)