@@ -87,7 +87,7 @@ class ReturnCodes:
8787 FATAL_ERROR = 2
8888
8989
90- def run_mypy_typechecking (cmd_options : List [str ]) -> int :
90+ def run_mypy_typechecking (cmd_options : List [str ]) -> Optional [ Union [ str , int ]] :
9191 fscache = FileSystemCache ()
9292 sources , options = process_options (cmd_options , fscache = fscache )
9393
@@ -215,7 +215,7 @@ def typecheck_in_new_subprocess(
215215
216216 def typecheck_in_same_process (
217217 self , execution_path : Path , mypy_cmd_options : List [Any ]
218- ) -> Tuple [int , Tuple [str , str ]]:
218+ ) -> Tuple [Optional [ Union [ str , int ]] , Tuple [str , str ]]:
219219 with utils .temp_environ (), utils .temp_path (), utils .temp_sys_modules ():
220220 # add custom environment variables
221221 for key , val in self .environment_variables .items ():
@@ -241,7 +241,6 @@ def runtest(self) -> None:
241241 temp_dir = tempfile .TemporaryDirectory (prefix = "pytest-mypy-" , dir = self .root_directory )
242242
243243 except (FileNotFoundError , PermissionError , NotADirectoryError ) as e :
244-
245244 raise TypecheckAssertionError (
246245 error_message = f"Testing base directory { self .root_directory } must exist and be writable"
247246 ) from e
0 commit comments