|
20 | 20 | _sdl_image_ver <= (2, 0, 5) and pygame.get_sdl_byteorder() == pygame.BIG_ENDIAN
|
21 | 21 | )
|
22 | 22 |
|
| 23 | +PG_DEPS_FROM_SYSTEM = "PG_DEPS_FROM_SYSTEM" in os.environ |
| 24 | + |
23 | 25 |
|
24 | 26 | def check_magic(f, magic_hexes):
|
25 | 27 | """Tests a given file to see if the magic hex matches."""
|
@@ -203,6 +205,11 @@ def testSavePNG32(self):
|
203 | 205 | pygame.image.get_sdl_image_version() == (2, 0, 5),
|
204 | 206 | "SDL image 2.0.5 png saving will save this 24 bit as RGBA, causing reader.asRGB8 to fail",
|
205 | 207 | )
|
| 208 | + @unittest.skipIf( |
| 209 | + PG_DEPS_FROM_SYSTEM, |
| 210 | + "If we are using system dependencies, we don't know the backend used " |
| 211 | + "for PNG saving, and this test only works with libpng.", |
| 212 | + ) |
206 | 213 | def testSavePNG24(self):
|
207 | 214 | """see if we can save a png with color values in the proper channels."""
|
208 | 215 | # Create a PNG file with known colors
|
@@ -238,6 +245,11 @@ def testSavePNG24(self):
|
238 | 245 | del reader
|
239 | 246 | os.remove(f_path)
|
240 | 247 |
|
| 248 | + @unittest.skipIf( |
| 249 | + PG_DEPS_FROM_SYSTEM, |
| 250 | + "If we are using system dependencies, we don't know the backend used " |
| 251 | + "for PNG saving, and this test only works with libpng.", |
| 252 | + ) |
241 | 253 | def testSavePNG8(self):
|
242 | 254 | """see if we can save an 8 bit png correctly"""
|
243 | 255 | # Create an 8-bit PNG file with known colors
|
@@ -269,7 +281,7 @@ def testSavePNG8(self):
|
269 | 281 | os.remove(f_path)
|
270 | 282 |
|
271 | 283 | @unittest.skipIf(
|
272 |
| - "PG_DEPS_FROM_SYSTEM" in os.environ, |
| 284 | + PG_DEPS_FROM_SYSTEM, |
273 | 285 | "If we are using system dependencies, we don't know the backend used "
|
274 | 286 | "for PNG saving, and this test only works with libpng.",
|
275 | 287 | )
|
|
0 commit comments