From 1fb3c970cf3fcca70bcf44ebef7bb9dcea1a20fd Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Thu, 20 Jan 2022 16:38:10 +0800 Subject: [PATCH] fix types and tests --- nvchecker/__main__.py | 6 +++--- tests/conftest.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nvchecker/__main__.py b/nvchecker/__main__.py index 4da9aae..6e812fc 100755 --- a/nvchecker/__main__.py +++ b/nvchecker/__main__.py @@ -7,7 +7,7 @@ from __future__ import annotations import sys import argparse import asyncio -from typing import Coroutine +from typing import Coroutine, Tuple from pathlib import Path import structlog @@ -87,9 +87,9 @@ def main() -> None: sys.exit(3) async def run( - result_coro: Coroutine[None, None, VersData], + result_coro: Coroutine[None, None, Tuple[VersData, bool]], runner_coro: Coroutine[None, None, None], -) -> VersData: +) -> Tuple[VersData, bool]: result_fu = asyncio.create_task(result_coro) runner_fu = asyncio.create_task(runner_coro) await runner_fu diff --git a/tests/conftest.py b/tests/conftest.py index d5031cc..17a5b6d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -38,7 +38,8 @@ async def run( result_coro = core.process_result(oldvers, result_q, entry_waiter) runner_coro = core.run_tasks(futures) - return await main.run(result_coro, runner_coro) + vers, _has_failures = await main.run(result_coro, runner_coro) + return vers @pytest.fixture(scope="module") async def get_version():