From 06b3edec536ac8278de2246decf5ad3445e690f5 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 15 May 2023 20:05:31 -0400 Subject: [PATCH] Use pre-python 3.9 type hint in cli qa --- qa/tests/cli/test_sch.py | 9 +++++---- qa/tests/cli/utils.py | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/qa/tests/cli/test_sch.py b/qa/tests/cli/test_sch.py index ae236c7ab3..6b7b589541 100644 --- a/qa/tests/cli/test_sch.py +++ b/qa/tests/cli/test_sch.py @@ -26,6 +26,7 @@ import re import os from pathlib import Path import pytest +from typing import List @pytest.mark.parametrize("test_file,output_dir,compare_fn,cli_args", [("cli/basic_test/basic_test.kicad_sch", "basic_test", "cli/basic_test/basic_test.png", []), @@ -36,7 +37,7 @@ def test_sch_export_svg( kitest, test_file: str, output_dir: str, compare_fn: str, - cli_args: list): + cli_args: List[str] ): input_file = kitest.get_data_file_path( test_file ) output_path = kitest.get_output_path( "cli/{}/".format( output_dir ) ) @@ -84,7 +85,7 @@ def test_sch_export_netlist( kitest, output_fn: str, line_skip_count: int, skip_compare: bool, - cli_args: list): + cli_args: List[str] ): input_file = kitest.get_data_file_path( test_file ) compare_filepath = kitest.get_data_file_path( "cli/basic_test/{}".format( output_fn ) ) @@ -116,7 +117,7 @@ def test_sch_export_netlist( kitest, def test_sch_export_pdf( kitest, test_file: str, output_fn: str, - cli_args: list): + cli_args: List[str] ): input_file = kitest.get_data_file_path( test_file ) output_filepath = kitest.get_output_path( "cli/" ).joinpath( output_fn ) @@ -142,7 +143,7 @@ def test_sch_export_pythonbom( kitest, test_file: str, output_fn: str, line_skip_count: int, - cli_args: list): + cli_args: List[str] ): input_file = kitest.get_data_file_path( test_file ) compare_filepath = kitest.get_data_file_path( "cli/basic_test/{}".format( output_fn ) ) diff --git a/qa/tests/cli/utils.py b/qa/tests/cli/utils.py index 083a9230cf..ae0b82006d 100644 --- a/qa/tests/cli/utils.py +++ b/qa/tests/cli/utils.py @@ -24,10 +24,11 @@ import difflib import logging import subprocess import os +from typing import Tuple logger = logging.getLogger("cli_util") -def run_and_capture( command: list ) -> tuple[ str, str, int ]: +def run_and_capture( command: list ) -> Tuple[ str, str, int ]: logger.info("Executing command \"%s\"", " ".join( command )) proc = subprocess.Popen( command,