tests: Ensure Python assertEventually() function uses correct main context

It should be doing already (or the tests would never work), but make it
clearer in the code that the same `GMainContext` is being iterated as is
being woken up in the rest of the test.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #2887
This commit is contained in:
Philip Withnall 2024-01-22 11:22:01 +00:00
parent aee343fe5c
commit 5278efbd63
2 changed files with 2 additions and 4 deletions

View File

@ -73,8 +73,7 @@ try:
printed on failure.
'''
while timeout >= 0:
context = GLib.MainContext.default()
while context.iteration(False):
while self.main_context.iteration(False):
pass
if condition():
break

View File

@ -73,8 +73,7 @@ try:
printed on failure.
'''
while timeout >= 0:
context = GLib.MainContext.default()
while context.iteration(False):
while self.main_context.iteration(False):
pass
if condition():
break