@@ -117,7 +117,10 @@ def test_match_font_all_exist(self):
117117 for font in fonts :
118118 path = pygame_font .match_font (font )
119119 self .assertFalse (path is None )
120- self .assertTrue (os .path .isabs (path ) and os .path .isfile (path ))
120+ self .assertTrue (
121+ os .path .isabs (path ) and os .path .isfile (path ),
122+ msg = f"path '{ path } ': exists: { os .path .exists (path )} is abs path:{ os .path .isabs (path )} and is file:{ os .path .isfile (path )} is link: { os .path .islink (path )} is mount: { os .path .ismount (path )} is dir: { os .path .isdir (path )} " ,
123+ )
121124
122125 def test_match_font_name (self ):
123126 """That match_font accepts names of various types"""
@@ -492,13 +495,12 @@ def test_set_underline(self):
492495 self .assertFalse (f .get_underline ())
493496
494497 def test_set_strikethrough (self ):
495- if pygame_font .__name__ != "pygame.ftfont" :
496- f = pygame_font .Font (None , 20 )
497- self .assertFalse (f .get_strikethrough ())
498- f .set_strikethrough (True )
499- self .assertTrue (f .get_strikethrough ())
500- f .set_strikethrough (False )
501- self .assertFalse (f .get_strikethrough ())
498+ f = pygame_font .Font (None , 20 )
499+ self .assertFalse (f .get_strikethrough ())
500+ f .set_strikethrough (True )
501+ self .assertTrue (f .get_strikethrough ())
502+ f .set_strikethrough (False )
503+ self .assertFalse (f .get_strikethrough ())
502504
503505 def test_bold_attr (self ):
504506 f = pygame_font .Font (None , 20 )
@@ -525,13 +527,12 @@ def test_set_underline_property(self):
525527 self .assertFalse (f .underline )
526528
527529 def test_set_strikethrough_property (self ):
528- if pygame_font .__name__ != "pygame.ftfont" :
529- f = pygame_font .Font (None , 20 )
530- self .assertFalse (f .strikethrough )
531- f .strikethrough = True
532- self .assertTrue (f .strikethrough )
533- f .strikethrough = False
534- self .assertFalse (f .strikethrough )
530+ f = pygame_font .Font (None , 20 )
531+ self .assertFalse (f .strikethrough )
532+ f .strikethrough = True
533+ self .assertTrue (f .strikethrough )
534+ f .strikethrough = False
535+ self .assertFalse (f .strikethrough )
535536
536537 def test_set_align_property (self ):
537538 if pygame_font .__name__ == "pygame.ftfont" :
@@ -863,16 +864,14 @@ def query(
863864 f .set_bold (bold )
864865 f .set_italic (italic )
865866 f .set_underline (underline )
866- if pygame_font .__name__ != "pygame.ftfont" :
867- f .set_strikethrough (strikethrough )
867+ f .set_strikethrough (strikethrough )
868868 s = f .render (text , antialiase , (0 , 0 , 0 ))
869869 screen .blit (s , (offset , y ))
870870 y += s .get_size ()[1 ] + spacing
871871 f .set_bold (False )
872872 f .set_italic (False )
873873 f .set_underline (False )
874- if pygame_font .__name__ != "pygame.ftfont" :
875- f .set_strikethrough (False )
874+ f .set_strikethrough (False )
876875 s = f .render ("(some comparison text)" , False , (0 , 0 , 0 ))
877876 screen .blit (s , (offset , y ))
878877 pygame .display .flip ()
@@ -900,8 +899,7 @@ def test_underline(self):
900899 self .assertTrue (self .query (underline = True ))
901900
902901 def test_strikethrough (self ):
903- if pygame_font .__name__ != "pygame.ftfont" :
904- self .assertTrue (self .query (strikethrough = True ))
902+ self .assertTrue (self .query (strikethrough = True ))
905903
906904 def test_antialiase (self ):
907905 self .assertTrue (self .query (antialiase = True ))
@@ -913,8 +911,7 @@ def test_italic_underline(self):
913911 self .assertTrue (self .query (italic = True , underline = True ))
914912
915913 def test_bold_strikethrough (self ):
916- if pygame_font .__name__ != "pygame.ftfont" :
917- self .assertTrue (self .query (bold = True , strikethrough = True ))
914+ self .assertTrue (self .query (bold = True , strikethrough = True ))
918915
919916
920917if __name__ == "__main__" :
0 commit comments