Skip to content

Commit dc9b842

Browse files
committed
test: add tests of report sorting options
1 parent cb647cd commit dc9b842

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_summary.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,16 @@ def test_sort_report_by_cover(self):
933933
report = self.get_summary_text(('report:sort', 'Cover'))
934934
self.assert_ordering(report, "file3.py", "file1.py", "file2.py")
935935

936+
def test_sort_report_by_cover_plus(self):
937+
# Sort the text report by the Cover column, including the explicit + sign.
938+
report = self.get_summary_text(('report:sort', '+Cover'))
939+
self.assert_ordering(report, "file3.py", "file1.py", "file2.py")
940+
941+
def test_sort_report_by_cover_reversed(self):
942+
# Sort the text report by the Cover column reversed.
943+
report = self.get_summary_text(('report:sort', '-Cover'))
944+
self.assert_ordering(report, "file2.py", "file1.py", "file3.py")
945+
936946
def test_sort_report_by_invalid_option(self):
937947
# Sort the text report by a nonsense column.
938948
msg = "Invalid sorting option: 'Xyzzy'"

0 commit comments

Comments
 (0)