Skip to content

Commit be47901

Browse files
authored
Merge pull request #2675 from pygame-community/ankith26-pytest
Minor changes to support pytest
2 parents 95b97b9 + 6db8255 commit be47901

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
@@ -1031,7 +1031,7 @@ def test_font_property_should_raise_exception_after_quit(self):
10311031

10321032

10331033
@unittest.skipIf(IS_PYPY, "pypy skip known failure") # TODO
1034-
class VisualTests(unittest.TestCase):
1034+
class VisualTestsInteractive(unittest.TestCase):
10351035
__tags__ = ["interactive"]
10361036

10371037
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
@@ -19,7 +19,7 @@
1919
)
2020

2121

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

332332
# load the file to make sure it was saved correctly.
@@ -410,7 +410,7 @@ def test_save__to_fileobject_w_namehint_argument(self):
410410
# ensure they are saved as the correct file type.
411411
handle.seek(0)
412412
self.assertEqual(
413-
(1, fmt), (test_magic(handle, magic_hex[fmt.lower()]), fmt)
413+
(1, fmt), (check_magic(handle, magic_hex[fmt.lower()]), fmt)
414414
)
415415
# load the file to make sure it was saved correctly.
416416
handle.flush()
@@ -1344,7 +1344,7 @@ def test_save_extended(self):
13441344
with open(temp_file_name, "rb") as file:
13451345
# Test the magic numbers at the start of the file to ensure
13461346
# they are saved as the correct file type.
1347-
self.assertEqual(1, (test_magic(file, magic_hex[fmt.lower()])))
1347+
self.assertEqual(1, (check_magic(file, magic_hex[fmt.lower()])))
13481348
# load the file to make sure it was saved correctly
13491349
loaded_file = pygame.image.load(temp_file_name)
13501350
self.assertEqual(loaded_file.get_at((0, 0)), surf.get_at((0, 0)))

0 commit comments

Comments
 (0)