11"""Test cases for the __main__ module."""
2+ from typing import Any
23from unittest .mock import Mock
34
45import pytest
@@ -15,28 +16,28 @@ def runner() -> CliRunner:
1516
1617
1718@pytest .fixture
18- def mock_validation_validate_extension (mocker : MockFixture ) -> Mock :
19+ def mock_validation_validate_extension (mocker : MockFixture ) -> Any :
1920 """Fixture for mocking validation.validate_extension."""
2021 return mocker .patch ("toml_validator.validation.validate_extension" )
2122
2223
2324@pytest .fixture
24- def mock_validation_validate_toml_no_error (mocker : MockFixture ) -> Mock :
25+ def mock_validation_validate_toml_no_error (mocker : MockFixture ) -> Any :
2526 """Fixture for mocking validation.validate_toml with no errors."""
2627 mock = mocker .patch ("toml_validator.validation.validate_toml" )
2728 mock .return_value = ""
2829 return mock
2930
3031
3132@pytest .fixture
32- def mock_validation_validate_toml_with_error (mocker : MockFixture ) -> Mock :
33+ def mock_validation_validate_toml_with_error (mocker : MockFixture ) -> Any :
3334 """Fixture for mocking validation.validate_toml with error."""
3435 mock = mocker .patch ("toml_validator.validation.validate_toml" )
3536 mock .return_value = "|some error description|"
3637 return mock
3738
3839
39- def test_main_without_argument (runner : CliRunner ):
40+ def test_main_without_argument (runner : CliRunner ) -> None :
4041 """It exits with a status code of 2."""
4142 result = runner .invoke (__main__ .main )
4243 assert result .exit_code == 2
@@ -46,7 +47,7 @@ def test_main_with_argument_success(
4647 runner : CliRunner ,
4748 mock_validation_validate_extension : Mock ,
4849 mock_validation_validate_toml_no_error : Mock ,
49- ):
50+ ) -> None :
5051 """It exits with a status code of zero."""
5152 with runner .isolated_filesystem ():
5253 with open ("file.toml" , "w" ) as f :
@@ -63,7 +64,7 @@ def test_main_with_argument_fail(
6364 runner : CliRunner ,
6465 mock_validation_validate_extension : Mock ,
6566 mock_validation_validate_toml_with_error : Mock ,
66- ):
67+ ) -> None :
6768 """It outputs error."""
6869 with runner .isolated_filesystem ():
6970 with open ("file.toml" , "w" ) as f :
@@ -77,7 +78,7 @@ def test_main_with_argument_fail(
7778
7879
7980@pytest .mark .e2e
80- def test_main_without_arguments_in_production_env (runner : CliRunner ):
81+ def test_main_without_arguments_in_production_env (runner : CliRunner ) -> None :
8182 """It exits with a status code of 2 (e2e)."""
8283 result = runner .invoke (__main__ .main )
8384 assert result .exit_code == 2
0 commit comments