test_mpris.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:scarlett_os 作者: bossjones 项目源码 文件源码
def main_loop():
    loop = GLib.MainLoop()
    timeout = GLib.Timeout(RUN_TIMEOUT)
    timeout.set_callback(lambda loop: loop.quit(), loop)
    timeout.attach()
    return loop


# https://github.com/Mirantis/ceph-lcm/blob/1b95e76503d9869da4bf4e91e24c848d3f683624/tests/controller/test_mainloop.py
# @pytest.fixture(scope='function')
# def main_loop_threading():
#     thread = threading.Thread(target=mainloop.main)
#     thread.start()
#
#     return thread
#
#
# def test_shutdown_callback(main_loop_threading):
#     time.sleep(.5)
#
#     assert main_loop_threading.is_alive()
#     mainloop.shutdown_callback()
#
#     time.sleep(.5)
#     assert not main_loop_threading.is_alive()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号