Skip to content

Commit 89ddf17

Browse files
author
Daniel Gallagher
committed
Inline tuple parameterized test tuple
1 parent d188f2e commit 89ddf17

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tests/file_contents_sorter_test.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
from pre_commit_hooks.file_contents_sorter import PASS
66

77

8-
# Input, expected return value, expected output
9-
TESTS = (
10-
(b'', PASS, b''),
11-
(b'lonesome\n', PASS, b'lonesome\n'),
12-
(b'missing_newline', PASS, b'missing_newline'),
13-
(b'alpha\nbeta\n', PASS, b'alpha\nbeta\n'),
14-
(b'beta\nalpha\n', FAIL, b'alpha\nbeta\n'),
15-
(b'C\nc\n', PASS, b'C\nc\n'),
16-
(b'c\nC\n', FAIL, b'C\nc\n'),
17-
(b'mag ical \n tre vor\n', FAIL, b' tre vor\nmag ical \n'),
18-
(b'@\n-\n_\n#\n', FAIL, b'#\n-\n@\n_\n'),
8+
@pytest.mark.parametrize(
9+
('input_s', 'expected_retval', 'output'),
10+
(
11+
(b'', PASS, b''),
12+
(b'lonesome\n', PASS, b'lonesome\n'),
13+
(b'missing_newline', PASS, b'missing_newline'),
14+
(b'alpha\nbeta\n', PASS, b'alpha\nbeta\n'),
15+
(b'beta\nalpha\n', FAIL, b'alpha\nbeta\n'),
16+
(b'C\nc\n', PASS, b'C\nc\n'),
17+
(b'c\nC\n', FAIL, b'C\nc\n'),
18+
(b'mag ical \n tre vor\n', FAIL, b' tre vor\nmag ical \n'),
19+
(b'@\n-\n_\n#\n', FAIL, b'#\n-\n@\n_\n'),
20+
)
1921
)
20-
21-
22-
@pytest.mark.parametrize(('input_s', 'expected_retval', 'output'), TESTS)
2322
def test_integration(input_s, expected_retval, output, tmpdir):
2423
path = tmpdir.join('file.txt')
2524
path.write_binary(input_s)

0 commit comments

Comments
 (0)