From 081b46165a99b590f4d437e6993ddd3643a9eea99395a6c57c4b5b54f7426aac Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 11 Mar 2024 21:29:01 +0000 Subject: [PATCH] Accepting request 1156382 from home:bnavigator:branches:devel:languages:python - Skip failing tests with dummy video driver on SDL2 * Add pygame-pr4169-videodummytests.patch gh#pygame/pygame#4169 OBS-URL: https://build.opensuse.org/request/show/1156382 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygame?expand=0&rev=53 --- pygame-pr4169-videodummytests.patch | 53 +++++++++++++++++++++++++++++ python-pygame.changes | 6 ++++ python-pygame.spec | 2 ++ 3 files changed, 61 insertions(+) create mode 100644 pygame-pr4169-videodummytests.patch diff --git a/pygame-pr4169-videodummytests.patch b/pygame-pr4169-videodummytests.patch new file mode 100644 index 0000000..0911782 --- /dev/null +++ b/pygame-pr4169-videodummytests.patch @@ -0,0 +1,53 @@ +From 656eb5d986873ec7297bd19afeee62f05d16170a Mon Sep 17 00:00:00 2001 +From: Emily Trau +Date: Tue, 5 Mar 2024 11:42:09 +1100 +Subject: [PATCH] Skip surface tests that fail when `SDL_VIDEODRIVER=dummy` + +--- + test/surface_test.py | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +diff --git a/test/surface_test.py b/test/surface_test.py +index e6dc1ad095..b1147d278f 100644 +--- a/test/surface_test.py ++++ b/test/surface_test.py +@@ -1091,6 +1091,10 @@ def test_image_convert_bug_131(self): + finally: + pygame.display.quit() + ++ @unittest.skipIf( ++ os.environ.get("SDL_VIDEODRIVER") == "dummy", ++ 'requires a non-"dummy" SDL_VIDEODRIVER', ++ ) + def test_convert_init(self): + """Ensure initialization exceptions are raised + for surf.convert().""" +@@ -1101,12 +1105,11 @@ def test_convert_init(self): + + pygame.display.init() + try: +- if os.environ.get("SDL_VIDEODRIVER") != "dummy": +- try: +- surf.convert(32) +- surf.convert(pygame.Surface((1, 1))) +- except pygame.error: +- self.fail("convert() should not raise an exception here.") ++ try: ++ surf.convert(32) ++ surf.convert(pygame.Surface((1, 1))) ++ except pygame.error: ++ self.fail("convert() should not raise an exception here.") + + self.assertRaisesRegex(pygame.error, "No video mode", surf.convert) + +@@ -1118,6 +1121,10 @@ def test_convert_init(self): + finally: + pygame.display.quit() + ++ @unittest.skipIf( ++ os.environ.get("SDL_VIDEODRIVER") == "dummy", ++ 'requires a non-"dummy" SDL_VIDEODRIVER', ++ ) + def test_convert_alpha_init(self): + """Ensure initialization exceptions are raised + for surf.convert_alpha().""" diff --git a/python-pygame.changes b/python-pygame.changes index 6961dd1..97ce57e 100644 --- a/python-pygame.changes +++ b/python-pygame.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 8 14:09:30 UTC 2024 - Ben Greiner + +- Skip failing tests with dummy video driver on SDL2 + * Add pygame-pr4169-videodummytests.patch gh#pygame/pygame#4169 + ------------------------------------------------------------------- Sat Dec 30 16:59:23 UTC 2023 - Dirk Müller diff --git a/python-pygame.spec b/python-pygame.spec index 7281198..afaa24d 100644 --- a/python-pygame.spec +++ b/python-pygame.spec @@ -24,6 +24,8 @@ Summary: A Python Module for Interfacing with the SDL Multimedia Library License: Apache-2.0 AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND libpng-2.0 URL: https://github.com/pygame/pygame Source0: https://files.pythonhosted.org/packages/source/p/pygame/pygame-%{version}.tar.gz +# PATCH-FIX-UPSTREAM pygame-pr4169-videodummytests.patch gh#pygame/pygame#4169 +Patch0: pygame-pr4169-videodummytests.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy} BuildRequires: %{python_module pip}