Skip to content

Commit cc79d72

Browse files
committed
tests: abstract results generation
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent 0418c47 commit cc79d72

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/patchtest2/tests/core.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,15 @@ def __init__(self, target_repo, series):
2828
[
2929
(
3030
"signed_off_by",
31-
[
32-
test_mbox_signed_off_by_presence(patch)
33-
for patch in self.series.patchdata
34-
],
31+
self._results(test_mbox_signed_off_by_presence),
3532
),
3633
(
3734
"shortlog_format",
38-
[
39-
test_mbox_shortlog_format(patch)
40-
for patch in self.series.patchdata
41-
],
35+
self._results(test_mbox_shortlog_format),
4236
),
4337
(
4438
"commit_message_presence",
45-
[
46-
test_mbox_commit_message_presence(patch)
47-
for patch in self.series.patchdata
48-
],
39+
self._results(test_mbox_commit_message_presence),
4940
),
5041
]
5142
)
@@ -59,6 +50,9 @@ def __init__(self, target_repo, series):
5950
]
6051
)
6152

53+
def _results(self, testname):
54+
return [testname(patch) for patch in self.series.patchdata]
55+
6256
def _print_result(self, category, tag):
6357
for value in self.results[category][tag]:
6458
print(value)

0 commit comments

Comments
 (0)