forked from pool/python-pygame
Accepting request 1157037 from devel:languages:python
Forwarded request #1156382 from bnavigator - 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/1157037 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pygame?expand=0&rev=40
This commit is contained in:
53
pygame-pr4169-videodummytests.patch
Normal file
53
pygame-pr4169-videodummytests.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 656eb5d986873ec7297bd19afeee62f05d16170a Mon Sep 17 00:00:00 2001
|
||||
From: Emily Trau <emily@downunderctf.com>
|
||||
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()."""
|
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 8 14:09:30 UTC 2024 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- 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 <dmueller@suse.com>
|
||||
|
||||
|
@@ -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}
|
||||
|
Reference in New Issue
Block a user