New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
display.get_driver() test and fix #1911
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
- I suspect the list of SDL video drivers is out of date. I believe the SDL wiki & the pygame docs are not keeping pace with the current state of the SDL codebase, the SDL wiki only claims to have a 'partial' list.
For example, I suspect there is a driver called 'wayland' on linux that is becoming fairly popular. The folders visible here are probably a decent guide to the video drivers that actually exist right now:
https://github.com/spurious/SDL-mirror/tree/6b6170caf69b4189c9a9d14fca96e97f09bbcc41/src/video
though those will be for SDL 2 and I suppose their driver names might not correspond exactly with the folder names, so you may profit best from a set union with your current list and those ones above for a better chance to catch-them-all.
- You should perhaps try calling
pygame.display.quit()
and seeing if a call toget_driver()
then returns None. It looks like the code does something like that.
Thanks for your quick reply @MyreMylar, I added more drivers and tested |
The CI tests on Travis are failing on that one specific build because that is our SDL 1 build and this function has a slightly different definition for SDL 1 and SDL 2. Right now on SDL 1 the function calls the VIDEO_INIT_CHECK() macro before doing anything: Lines 170 to 172 in c10a68e
which as you can see raises an assert if the display is not initialised. I think the best fix for this would likely be to add the Lines 697 to 706 in 9e8fedc
In basically the same place as it is in the sdl1 version seen here: Lines 741 to 749 in 9e8fedc
And then change the test to check this assert is being being raised using something like:
That should make the function's behaviour consistent on both SDL 1 and SDL 2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :)
It looks like @MyreMylar's requests were addressed, so I'll merge it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add unit test: display.get_driver() and closes #1744