Skip to content

Commit 64e8028

Browse files
committed
Use conventional parametrize in list tests
1 parent 1834204 commit 64e8028

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/test_lists.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
from babel import lists
44

55

6-
def test_format_list():
7-
for list, locale, expected in [
8-
([], 'en', ''),
9-
(['string'], 'en', 'string'),
10-
(['string1', 'string2'], 'en', 'string1 and string2'),
11-
(['string1', 'string2', 'string3'], 'en', 'string1, string2, and string3'),
12-
(['string1', 'string2', 'string3'], 'zh', 'string1、string2和string3'),
13-
(['string1', 'string2', 'string3', 'string4'], 'ne', 'string1,string2, string3 र string4'),
14-
]:
15-
assert lists.format_list(list, locale=locale) == expected
6+
@pytest.mark.parametrize(('list', 'locale', 'expected'), [
7+
([], 'en', ''),
8+
(['string'], 'en', 'string'),
9+
(['string1', 'string2'], 'en', 'string1 and string2'),
10+
(['string1', 'string2', 'string3'], 'en', 'string1, string2, and string3'),
11+
(['string1', 'string2', 'string3'], 'zh', 'string1、string2和string3'),
12+
(['string1', 'string2', 'string3', 'string4'], 'ne', 'string1,string2, string3 र string4'),
13+
])
14+
def test_format_list(list, locale, expected):
15+
assert lists.format_list(list, locale=locale) == expected
1616

1717

1818
def test_format_list_error():

0 commit comments

Comments
 (0)