|
11 | 11 |
|
12 | 12 | is32bit = sys.maxsize <= 2**32 |
13 | 13 | ismacos = sys.platform == "darwin" |
| 14 | +iswindows = "win" in sys.platform |
| 15 | +isconda = os.getenv("CONDA_PREFIX") != None |
14 | 16 |
|
15 | 17 | formats = ["bmp", |
16 | 18 | "cur", |
|
33 | 35 | #"xv", |
34 | 36 | ] |
35 | 37 |
|
36 | | -# SVG unsupported on SDL2_image < 2.0.2 |
37 | | -if sdlimage.dll.version < 2002: |
| 38 | +# SVG unsupported on SDL2_image < 2.0.2 as well as in Conda's current (2.0.5) |
| 39 | +# Windows binaries |
| 40 | +if sdlimage.dll.version < 2002 or (isconda and iswindows): |
38 | 41 | formats.remove("svg") |
39 | 42 |
|
40 | 43 | # As of SDL2_image 2.0.5, XCF support seems to be broken on 32-bit builds |
41 | | -# XCF support is also broken in official SDL2_image macOS .frameworks |
42 | | -if is32bit or ismacos: |
| 44 | +# XCF support is also broken in official SDL2_image macOS .frameworks and |
| 45 | +# Conda's SDL2_image Windows binaries |
| 46 | +bad_xcf = False |
| 47 | +if is32bit or ismacos or (isconda and iswindows): |
43 | 48 | formats.remove("xcf") |
| 49 | + bad_xcf = True |
44 | 50 |
|
45 | 51 | # WEBP support seems to be broken in the 32-bit Windows SDL2_image 2.0.2 binary |
46 | 52 | bad_webp = is32bit and sdlimage.dll.version == 2002 |
@@ -254,6 +260,7 @@ def test_IMG_LoadPNM_RW(self): |
254 | 260 | surface.SDL_FreeSurface(sf) |
255 | 261 |
|
256 | 262 | @pytest.mark.skipif(sdlimage.dll.version < 2002, reason="Added in 2.0.2") |
| 263 | + @pytest.mark.xfail(isconda and iswindows, reason="Broken w/ win64 Conda") |
257 | 264 | def test_IMG_LoadSVG_RW(self): |
258 | 265 | fp = open(_get_image_path("svg"), "rb") |
259 | 266 | sf = sdlimage.IMG_LoadSVG_RW(rwops.rw_from_object(fp)) |
@@ -283,7 +290,7 @@ def test_IMG_LoadWEBP_RW(self): |
283 | 290 | assert isinstance(sf.contents, surface.SDL_Surface) |
284 | 291 | surface.SDL_FreeSurface(sf) |
285 | 292 |
|
286 | | - @pytest.mark.xfail(is32bit or ismacos, reason="XCF currently broken on 32-bit and macOS") |
| 293 | + @pytest.mark.xfail(bad_xcf, reason="XCF currently broken on some platforms") |
287 | 294 | def test_IMG_LoadXCF_RW(self): |
288 | 295 | fp = open(_get_image_path("xcf"), "rb") |
289 | 296 | sf = sdlimage.IMG_LoadXCF_RW(rwops.rw_from_object(fp)) |
@@ -397,6 +404,7 @@ def test_IMG_isPNM(self): |
397 | 404 | assert not sdlimage.IMG_isPNM(imgrw) |
398 | 405 |
|
399 | 406 | @pytest.mark.skipif(sdlimage.dll.version < 2002, reason="Added in 2.0.2") |
| 407 | + @pytest.mark.xfail(isconda and iswindows, reason="Broken w/ win64 Conda") |
400 | 408 | def test_IMG_isSVG(self): |
401 | 409 | for fmt in formats: |
402 | 410 | fpath = _get_image_path(fmt) |
@@ -427,7 +435,7 @@ def test_IMG_isWEBP(self): |
427 | 435 | else: |
428 | 436 | assert not sdlimage.IMG_isWEBP(imgrw) |
429 | 437 |
|
430 | | - @pytest.mark.xfail(ismacos, reason="XCF currently broken on macOS") |
| 438 | + @pytest.mark.xfail(bad_xcf, reason="XCF currently broken on some platforms") |
431 | 439 | def test_IMG_isXCF(self): |
432 | 440 | for fmt in formats: |
433 | 441 | fpath = _get_image_path(fmt) |
|
0 commit comments