def test_set_error(self):
e = pygame.get_error()
self.assertTrue(e == "" or
# This may be returned by SDL_mixer built with
# FluidSynth support. Setting environment variable
# SDL_SOUNDFONTS to the path of a valid sf2 file
# removes the error message.
e == "No SoundFonts have been requested",
e)
pygame.set_error("hi")
self.assertEqual(pygame.get_error(), "hi")
pygame.set_error("")
self.assertEqual(pygame.get_error(), "")
评论列表
文章目录