fix(mypy): Fix files in scripts/ (#4320)

This commit is contained in:
Christian Clauss
2021-04-07 04:42:56 +02:00
committed by GitHub
parent 531d2d6d7e
commit 252df0a149
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ def convert_path_to_module(file_path: pathlib.Path) -> ModuleType:
"""Converts a file path to a Python module"""
spec = importlib.util.spec_from_file_location(file_path.name, str(file_path))
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
spec.loader.exec_module(module) # type: ignore
return module
@ -89,5 +89,5 @@ def test_project_euler(solution_path: pathlib.Path) -> None:
problem_number: str = solution_path.parent.name[8:].zfill(3)
expected: str = PROBLEM_ANSWERS[problem_number]
solution_module = convert_path_to_module(solution_path)
answer = str(solution_module.solution())
answer = str(solution_module.solution()) # type: ignore
assert answer == expected, f"Expected {expected} but got {answer}"