@@ -117,7 +117,10 @@ def test_match_font_all_exist(self):
117
117
for font in fonts :
118
118
path = pygame_font .match_font (font )
119
119
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
+ )
121
124
122
125
def test_match_font_name (self ):
123
126
"""That match_font accepts names of various types"""
@@ -492,13 +495,12 @@ def test_set_underline(self):
492
495
self .assertFalse (f .get_underline ())
493
496
494
497
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 ())
502
504
503
505
def test_bold_attr (self ):
504
506
f = pygame_font .Font (None , 20 )
@@ -525,13 +527,12 @@ def test_set_underline_property(self):
525
527
self .assertFalse (f .underline )
526
528
527
529
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 )
535
536
536
537
def test_set_align_property (self ):
537
538
if pygame_font .__name__ == "pygame.ftfont" :
@@ -863,16 +864,14 @@ def query(
863
864
f .set_bold (bold )
864
865
f .set_italic (italic )
865
866
f .set_underline (underline )
866
- if pygame_font .__name__ != "pygame.ftfont" :
867
- f .set_strikethrough (strikethrough )
867
+ f .set_strikethrough (strikethrough )
868
868
s = f .render (text , antialiase , (0 , 0 , 0 ))
869
869
screen .blit (s , (offset , y ))
870
870
y += s .get_size ()[1 ] + spacing
871
871
f .set_bold (False )
872
872
f .set_italic (False )
873
873
f .set_underline (False )
874
- if pygame_font .__name__ != "pygame.ftfont" :
875
- f .set_strikethrough (False )
874
+ f .set_strikethrough (False )
876
875
s = f .render ("(some comparison text)" , False , (0 , 0 , 0 ))
877
876
screen .blit (s , (offset , y ))
878
877
pygame .display .flip ()
@@ -900,8 +899,7 @@ def test_underline(self):
900
899
self .assertTrue (self .query (underline = True ))
901
900
902
901
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 ))
905
903
906
904
def test_antialiase (self ):
907
905
self .assertTrue (self .query (antialiase = True ))
@@ -913,8 +911,7 @@ def test_italic_underline(self):
913
911
self .assertTrue (self .query (italic = True , underline = True ))
914
912
915
913
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 ))
918
915
919
916
920
917
if __name__ == "__main__" :
0 commit comments