Python: Make the timer test more robust

It seems that with the latest winit, quit_event_loop() might take a little longer and the timer fires once more. We don't really care how long quit_event_loop() takes in this test, merely that the timer firest and that we can terminate the loop.

Fixes #5484
This commit is contained in:
Simon Hausmann 2024-06-27 09:08:12 +02:00 committed by Simon Hausmann
parent 2ffed918ab
commit 624796d53e

View file

@ -11,8 +11,8 @@ def test_timer():
counter = 0
def quit_after_two_invocations():
global counter
counter = counter + 1
if counter >= 2:
counter = min(counter + 1, 2)
if counter == 2:
native.quit_event_loop()
test_timer = native.Timer()