Skip to content

Commit

Permalink
test: add tests of report sorting options
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Feb 26, 2021
1 parent cb647cd commit dc9b842
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,16 @@ def test_sort_report_by_cover(self):
report = self.get_summary_text(('report:sort', 'Cover'))
self.assert_ordering(report, "file3.py", "file1.py", "file2.py")

def test_sort_report_by_cover_plus(self):
# Sort the text report by the Cover column, including the explicit + sign.
report = self.get_summary_text(('report:sort', '+Cover'))
self.assert_ordering(report, "file3.py", "file1.py", "file2.py")

def test_sort_report_by_cover_reversed(self):
# Sort the text report by the Cover column reversed.
report = self.get_summary_text(('report:sort', '-Cover'))
self.assert_ordering(report, "file2.py", "file1.py", "file3.py")

def test_sort_report_by_invalid_option(self):
# Sort the text report by a nonsense column.
msg = "Invalid sorting option: 'Xyzzy'"
Expand Down

0 comments on commit dc9b842

Please sign in to comment.