From c7d7e516528c9cef0caa8f5957d1b7c5a4dabd04 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Fri, 24 Dec 2021 19:54:09 +0100 Subject: requirements update --- requirements.pip.dev.txt | 2 +- requirements.pip.runtime.txt | 6 +++--- src_py/opcut/main.py | 4 ++-- test_pytest/conftest.py | 9 +++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/requirements.pip.dev.txt b/requirements.pip.dev.txt index 951d881..d46798e 100644 --- a/requirements.pip.dev.txt +++ b/requirements.pip.dev.txt @@ -4,7 +4,7 @@ build ~= 0.7.0 doit ~= 0.33.1 flake8 ~= 3.9.2 furo >= 2021.10.9 -hat-doit ~= 0.7.3 +hat-doit ~= 0.7.4 peru >= 1.3.0 pytest ~= 6.2.5 pytest-asyncio ~= 0.15.1 diff --git a/requirements.pip.runtime.txt b/requirements.pip.runtime.txt index 344df28..1a49035 100644 --- a/requirements.pip.runtime.txt +++ b/requirements.pip.runtime.txt @@ -1,6 +1,6 @@ -aiohttp ~= 3.8.0 +aiohttp ~= 3.8.1 appdirs ~= 1.4.4 click ~= 8.0.3 -hat-aio ~= 0.5.1 -hat-json ~= 0.5.2 +hat-aio ~= 0.6.0 +hat-json ~= 0.5.3 pycairo ~= 1.20.1 diff --git a/src_py/opcut/main.py b/src_py/opcut/main.py index b428950..df9987f 100644 --- a/src_py/opcut/main.py +++ b/src_py/opcut/main.py @@ -116,7 +116,7 @@ def generate_output(output_type: common.OutputType, def server(host: str, port: int): """Run server""" - aio.init_asyncio() + loop = aio.init_asyncio() async def run(): server = await opcut.server.create(host, port) @@ -128,7 +128,7 @@ def server(host: str, await aio.uncancellable(server.async_close()) with contextlib.suppress(asyncio.CancelledError): - aio.run_asyncio(run()) + aio.run_asyncio(run(), loop=loop) if __name__ == '__main__': diff --git a/test_pytest/conftest.py b/test_pytest/conftest.py index 39370af..866d3ce 100644 --- a/test_pytest/conftest.py +++ b/test_pytest/conftest.py @@ -1,16 +1,17 @@ -import asyncio - import pytest from hat import aio +loop = None + + @pytest.fixture(scope='session') def event_loop(): - loop = asyncio.get_event_loop() yield loop loop.close() def pytest_configure(config): - aio.init_asyncio() + global loop + loop = aio.init_asyncio() -- cgit v1.2.3-70-g09d2