Skip to content

Commit da9c230

Browse files
committed
- r fix type hints
1 parent bf2e659 commit da9c230

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

approvaltests/file_approver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import filecmp
22
import os
33
import pathlib
4-
from typing import Optional, Callable
4+
from typing import Optional, Callable, List
55

66
from approval_utilities.utilities.multiline_string_utils import remove_indentation_from
77
from approvaltests.core.comparator import Comparator
@@ -38,8 +38,8 @@ def compare(self, received_path: str, approved_path: str) -> bool:
3838

3939

4040
class FileApprover:
41-
previous_approved = []
42-
allowed_duplicates = []
41+
previous_approved: List[str] = []
42+
allowed_duplicates: List[Callable[[str], bool]] = []
4343

4444
@staticmethod
4545
def verify(
@@ -65,7 +65,7 @@ def verify(
6565
return None
6666

6767
@staticmethod
68-
def get_duplicate_verify_error_message(approved):
68+
def get_duplicate_verify_error_message(approved: str) -> str:
6969
return remove_indentation_from(
7070
f"""
7171
We noticed that you called verify more than once in the same test.

mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ disable_error_code = arg-type
2020
[mypy-approvaltests.reporters.generic_diff_reporter_factory]
2121
disable_error_code = abstract
2222

23-
[mypy-approvaltests.file_approver]
24-
disable_error_code = var-annotated, no-any-return
25-
2623
[mypy-approvaltests.reporters.default_reporter_factory]
2724
disable_error_code = no-any-return
2825

0 commit comments

Comments
 (0)