Skip to content

Commit

Permalink
version_test: Don't assert that SDL_GetRevision() starts with http (#249
Browse files Browse the repository at this point in the history
)

The default format is going to change in 2.25.x, and in git main it
currently starts with "SDL-".

SDL specifically documents the result of this function as "not intended
to be reliable in any way", so it seems wrong to have pysdl2's tests fail
whenever the format changes. To address that, turn unexpected formats
into an xfail, so that they're flagged as something to investigate but
do not make the unit tests fail when used as a QA gate.

Closes: #248
Signed-off-by: Simon McVittie <smcv@collabora.com>

Signed-off-by: Simon McVittie <smcv@collabora.com>
  • Loading branch information
smcv committed Nov 2, 2022
1 parent abc3bfa commit ffa8853
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdl2/test/version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def test_SDL_GetRevision():
# If revision not empty string (e.g. Conda), test the prefix
if len(rev):
if dll.version_tuple >= (2, 0, 16):
assert rev[0:4] == b"http"
if rev[0:4] not in (b"http", b"SDL-"):
pytest.xfail("no API guarantee about the format of this string")
else:
assert rev[0:3] == b"hg-"

Expand Down

0 comments on commit ffa8853

Please sign in to comment.