Fix interactive midi test_time with pytest test -s
#3018
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A little while ago @ankith26 changed something to make pytest work better with out test suite. I like the output of pytest so I was trying it out today and, after a little fidddling I realised we need to run it with the
-s
flag, like so:to make all the command line unit tests work.
Anyway, with that they all seem to work OK through pytest, bar two tests. This 'how much time has passed since
midi.init()
was called was one of them - for some reason it takes at least 10 times as long to go frompygame.midi.init()
topygame.midi.time()
when running the test through pytest. I'm not sure if we want to cater to pytest by making a small change to this test or not, but anyway I though I'd submit a PR.The test for
set_gamma_ramp()
also doesn't pass now - I think it should probably be removed as the function is deprecated in pygame, the corresponding SDL function is also deprecated and it doesn't work at all on my PC at all anymore - I expect windows has removed support for it.The other thing running pytest does is show all the deprecated functions we are testing in the tests without supressing the generated warnings - this make the test output a bit messy and harder to spot deprecation warnings not coming from our test code.
Warnings output from pytest test -s