Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 74e6bfc

Browse files
author
staticdev
committed
Mypy fixes
1 parent fe98bd4 commit 74e6bfc

5 files changed

Lines changed: 15 additions & 31 deletions

File tree

mypy.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ warn_unreachable = True
1919
warn_unused_configs = True
2020
warn_unused_ignores = True
2121

22-
[mypy-tests.*]
23-
disallow_untyped_decorators = False
22+
[mypy-_pytest.*]
23+
ignore_missing_imports = True
2424

2525
[mypy-pytest]
2626
ignore_missing_imports = True
2727

28-
[mypy-_pytest.*]
28+
[mypy-pytest_mock]
2929
ignore_missing_imports = True
3030

31+
[mypy-tests.*]
32+
disallow_untyped_decorators = False
33+
3134
[mypy-tomlkit.*]
3235
ignore_missing_imports = True

pytest_mock/__init__.pyi

Lines changed: 0 additions & 3 deletions
This file was deleted.

pytest_mock/plugin.pyi

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/test_main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test cases for the __main__ module."""
2+
from typing import Any
23
from unittest.mock import Mock
34

45
import click.testing
@@ -15,21 +16,21 @@ def runner() -> click.testing.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|"

tests/test_validation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test cases for the validation module."""
2+
from typing import Any
23
from unittest.mock import Mock
34

45
import pytest
@@ -9,27 +10,27 @@
910

1011

1112
@pytest.fixture
12-
def mock_tomlkit_parse(mocker: MockFixture) -> Mock:
13+
def mock_tomlkit_parse(mocker: MockFixture) -> Any:
1314
"""Fixture for mocking tomlkit.parse."""
1415
return mocker.patch("tomlkit.parse")
1516

1617

1718
@pytest.fixture
18-
def mock_tomlkit_parse_exception(mocker: MockFixture) -> Mock:
19+
def mock_tomlkit_parse_exception(mocker: MockFixture) -> Any:
1920
"""Fixture for mocking tomlkit.parse."""
2021
mock = mocker.patch("tomlkit.parse")
2122
mock.side_effect = TOMLKitError("|some tomlkit error|")
2223
return mock
2324

2425

2526
@pytest.fixture
26-
def mock_open_valid_file(mocker: MockFixture) -> Mock:
27+
def mock_open_valid_file(mocker: MockFixture) -> Any:
2728
"""Fixture for mocking build-in open for valid TOML file."""
2829
return mocker.patch("builtins.open", mocker.mock_open(read_data="[x]\na = 3"))
2930

3031

3132
@pytest.fixture
32-
def mock_open_invalid_file(mocker: MockFixture) -> Mock:
33+
def mock_open_invalid_file(mocker: MockFixture) -> Any:
3334
"""Fixture for mocking build-in open for valid TOML file."""
3435
return mocker.patch(
3536
"builtins.open", mocker.mock_open(read_data="[x]\na = 3\n[x]\na = 3")

0 commit comments

Comments
 (0)