Skip to content

Commit 6db8255

Browse files
committed
Minor changes to support pytest
1 parent 04cc697 commit 6db8255

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

test/display_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ def test_set_gamma_ramp(self):
832832
pygame.display.quit()
833833

834834

835-
class FullscreenToggleTests(unittest.TestCase):
835+
class FullscreenToggleTestsInteractive(unittest.TestCase):
836836
__tags__ = ["interactive"]
837837

838838
screen = None

test/font_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def test_font_property_should_raise_exception_after_quit(self):
10211021

10221022

10231023
@unittest.skipIf(IS_PYPY, "pypy skip known failure") # TODO
1024-
class VisualTests(unittest.TestCase):
1024+
class VisualTestsInteractive(unittest.TestCase):
10251025
__tags__ = ["interactive"]
10261026

10271027
screen = None

test/ftfont_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import sys
22
import os
33
import unittest
4-
from pygame.tests import font_test
4+
5+
from . import font_test
56

67
import pygame.ftfont
78

test/image_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919

2020

21-
def test_magic(f, magic_hexes):
21+
def check_magic(f, magic_hexes):
2222
"""Tests a given file to see if the magic hex matches."""
2323
data = f.read(len(magic_hexes))
2424
if len(data) != len(magic_hexes):
@@ -325,7 +325,7 @@ def test_save(self):
325325
# Test the magic numbers at the start of the file to ensure
326326
# they are saved as the correct file type.
327327
self.assertEqual(
328-
(1, fmt), (test_magic(handle, magic_hex[fmt.lower()]), fmt)
328+
(1, fmt), (check_magic(handle, magic_hex[fmt.lower()]), fmt)
329329
)
330330

331331
# load the file to make sure it was saved correctly.
@@ -409,7 +409,7 @@ def test_save__to_fileobject_w_namehint_argument(self):
409409
# ensure they are saved as the correct file type.
410410
handle.seek(0)
411411
self.assertEqual(
412-
(1, fmt), (test_magic(handle, magic_hex[fmt.lower()]), fmt)
412+
(1, fmt), (check_magic(handle, magic_hex[fmt.lower()]), fmt)
413413
)
414414
# load the file to make sure it was saved correctly.
415415
handle.flush()
@@ -1893,7 +1893,7 @@ def test_save_extended(self):
18931893
with open(temp_file_name, "rb") as file:
18941894
# Test the magic numbers at the start of the file to ensure
18951895
# they are saved as the correct file type.
1896-
self.assertEqual(1, (test_magic(file, magic_hex[fmt.lower()])))
1896+
self.assertEqual(1, (check_magic(file, magic_hex[fmt.lower()])))
18971897
# load the file to make sure it was saved correctly
18981898
loaded_file = pygame.image.load(temp_file_name)
18991899
self.assertEqual(loaded_file.get_at((0, 0)), surf.get_at((0, 0)))

0 commit comments

Comments
 (0)