diff --git a/tests/test_cli.py b/tests/test_cli.py index fea0981..45a640d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -76,7 +76,7 @@ runner = CliRunner() "111111", ], ) -def test_cli(file_number: str): +def test_cli(file_number: str) -> None: input_path = f"tests/in/{file_number}.yaml" output_path = f"{file_number}.png" result = runner.invoke(cli.app, ["-o", output_path, input_path]) diff --git a/tests/test_extends.py b/tests/test_extends.py index a655be7..ef8f755 100644 --- a/tests/test_extends.py +++ b/tests/test_extends.py @@ -3,7 +3,7 @@ import pytest from compose_viz.extends import Extends -def test_extend_init_normal(): +def test_extend_init_normal() -> None: try: Extends(service_name="frontend", from_file="tests/in/000001.yaml") @@ -12,7 +12,7 @@ def test_extend_init_normal(): assert False, e -def test_extend_init_without_from_file(): +def test_extend_init_without_from_file() -> None: try: Extends(service_name="frontend") @@ -21,6 +21,6 @@ def test_extend_init_without_from_file(): assert False, e -def test_extend_init_without_service_name(): +def test_extend_init_without_service_name() -> None: with pytest.raises(TypeError): Extends(from_file="tests/in/000001.yaml") # type: ignore diff --git a/tests/test_parse_file.py b/tests/test_parse_file.py index 1c6150c..f91249d 100644 --- a/tests/test_parse_file.py +++ b/tests/test_parse_file.py @@ -1537,7 +1537,7 @@ from compose_viz.service import Service ), ], ) -def test_parse_file(test_input, expected): +def test_parse_file(test_input: str, expected: Compose) -> None: parser = Parser() actual = parser.parse(test_input) diff --git a/tests/test_parser.py b/tests/test_parser.py index e28a9f9..e541a70 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -3,16 +3,16 @@ import pytest from compose_viz.parser import Parser -def test_parser_error_parsing_file(): +def test_parser_error_parsing_file() -> None: with pytest.raises(RuntimeError, match=r"Error parsing file 'tests/in/invalid.yaml'.*"): Parser().parse("tests/in/invalid.yaml") -def test_parser_invalid_yaml(): +def test_parser_invalid_yaml() -> None: with pytest.raises(RuntimeError, match=r"Empty yaml file, aborting."): Parser().parse("tests/in/000000.yaml") -def test_parser_no_services_found(): +def test_parser_no_services_found() -> None: with pytest.raises(RuntimeError, match=r"No services found, aborting."): Parser().parse("tests/in/no-services.yaml") diff --git a/tests/test_service.py b/tests/test_service.py index 4006e2d..223f471 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -4,7 +4,7 @@ from compose_viz.extends import Extends from compose_viz.service import Service -def test_service_init(): +def test_service_init() -> None: with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."): Service(name="frontend") diff --git a/tests/test_version.py b/tests/test_version.py index a3bd0eb..27ecc67 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -5,7 +5,7 @@ from compose_viz import __app_name__, __version__, cli runner = CliRunner() -def test_version(): +def test_version() -> None: result = runner.invoke(cli.app, ["--version"]) assert result.exit_code == 0