mirror of https://github.com/kivy/kivy.git
commit
fd7e81ef82
|
@ -154,8 +154,6 @@ class UnitKivyApp(object):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
from kivy.clock import Clock
|
||||
self.async_sleep = Clock._async_lib.sleep
|
||||
|
||||
def started_app(*largs):
|
||||
self.app_has_started = True
|
||||
|
@ -165,11 +163,14 @@ class UnitKivyApp(object):
|
|||
self.app_has_stopped = True
|
||||
self.fbind('on_stop', stopped_app)
|
||||
|
||||
async def async_run(self, async_lib=None):
|
||||
def set_async_lib(self, async_lib):
|
||||
from kivy.clock import Clock
|
||||
if async_lib is not None:
|
||||
Clock.init_async_lib(async_lib)
|
||||
self.async_sleep = Clock._async_lib.sleep
|
||||
|
||||
async def async_run(self, async_lib=None):
|
||||
self.set_async_lib(async_lib)
|
||||
return await super(UnitKivyApp, self).async_run(async_lib=async_lib)
|
||||
|
||||
def resolve_widget(self, base_widget=None):
|
||||
|
|
|
@ -73,6 +73,7 @@ async def kivy_app(request, nursery):
|
|||
Window.canvas.clear()
|
||||
|
||||
app = request.param[0]()
|
||||
app.set_async_lib(async_lib)
|
||||
|
||||
if async_lib == 'asyncio':
|
||||
import asyncio
|
||||
|
@ -80,6 +81,8 @@ async def kivy_app(request, nursery):
|
|||
loop.create_task(app.async_run())
|
||||
else:
|
||||
nursery.start_soon(app.async_run)
|
||||
from kivy.clock import Clock
|
||||
Clock._max_fps = 0
|
||||
|
||||
ts = time.perf_counter()
|
||||
while not app.app_has_started:
|
||||
|
|
Loading…
Reference in New Issue