@@ -866,13 +866,13 @@ def test_test_data(self):
866
866
# sort in three different orders.
867
867
report = self .get_summary_text ()
868
868
print (report )
869
- # Name Stmts Miss Cover
870
- # --------------------------------------------
871
- # tests/test_api .py 339 155 54%
872
- # tests/test_backward .py 13 3 77%
873
- # tests/test_coverage .py 234 228 3%
874
- # --------------------------------------------
875
- # TOTAL 586 386 34%
869
+ # Name Stmts Miss Cover
870
+ # ------------------------------
871
+ # file1 .py 339 155 54%
872
+ # file2 .py 13 3 77%
873
+ # file3 .py 234 228 3%
874
+ # ------------------------------
875
+ # TOTAL 586 386 34%
876
876
877
877
lines = report .splitlines ()[2 :- 2 ]
878
878
self .assertEqual (len (lines ), 3 )
@@ -901,6 +901,7 @@ def test_print_missing(self):
901
901
def assert_ordering (self , text , * words ):
902
902
"""Assert that the `words` appear in order in `text`."""
903
903
indexes = list (map (text .find , words ))
904
+ assert - 1 not in indexes
904
905
self .assertEqual (
905
906
indexes , sorted (indexes ),
906
907
"The words %r don't appear in order in %r" % (words , text )
@@ -909,17 +910,17 @@ def assert_ordering(self, text, *words):
909
910
def test_sort_report_by_stmts (self ):
910
911
# Sort the text report by the Stmts column.
911
912
report = self .get_summary_text (('report:sort' , 'Stmts' ))
912
- self .assert_ordering (report , "test_backward .py" , "test_coverage .py" , "test_api .py" )
913
+ self .assert_ordering (report , "file2 .py" , "file3 .py" , "file1 .py" )
913
914
914
915
def test_sort_report_by_missing (self ):
915
916
# Sort the text report by the Missing column.
916
917
report = self .get_summary_text (('report:sort' , 'Miss' ))
917
- self .assert_ordering (report , "test_backward .py" , "test_api .py" , "test_coverage .py" )
918
+ self .assert_ordering (report , "file2 .py" , "file1 .py" , "file3 .py" )
918
919
919
920
def test_sort_report_by_cover (self ):
920
921
# Sort the text report by the Cover column.
921
922
report = self .get_summary_text (('report:sort' , 'Cover' ))
922
- self .assert_ordering (report , "test_coverage .py" , "test_api .py" , "test_backward .py" )
923
+ self .assert_ordering (report , "file3 .py" , "file1 .py" , "file2 .py" )
923
924
924
925
def test_sort_report_by_invalid_option (self ):
925
926
# Sort the text report by a nonsense column.
0 commit comments