diff --git a/mypy.ini b/mypy.ini index ea6963a91d..4cedc08c21 100644 --- a/mypy.ini +++ b/mypy.ini @@ -14,14 +14,11 @@ disallow_any_generics = True warn_no_return = True no_implicit_optional = True warn_redundant_casts = True +warn_unused_ignores = True # Display the codes needed for # type: ignore[code] annotations. show_error_codes = True -# It's useful to try this occasionally, and keep it clean; but when -# someone fixes a type error we don't want to add a burden for them. -#warn_unused_ignores = True - # We use a lot of third-party libraries we don't have stubs for, as # well as a handful of our own modules that we haven't told mypy how # to find. Ignore them. (For some details, see: diff --git a/zerver/lib/test_runner.py b/zerver/lib/test_runner.py index fa00625afa..8bdeee1d61 100644 --- a/zerver/lib/test_runner.py +++ b/zerver/lib/test_runner.py @@ -152,8 +152,8 @@ class TextTestResult(runner.TextTestResult): self.failed_tests: List[str] = [] def addInfo(self, test: TestCase, msg: str) -> None: - self.stream.write(msg) # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139 - self.stream.flush() # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139 + self.stream.write(msg) + self.stream.flush() def addInstrumentation(self, test: TestCase, data: Dict[str, Any]) -> None: append_instrumentation_data(data) @@ -161,7 +161,7 @@ class TextTestResult(runner.TextTestResult): def startTest(self, test: TestCase) -> None: TestResult.startTest(self, test) self.stream.writeln(f"Running {full_test_name(test)}") # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139 - self.stream.flush() # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139 + self.stream.flush() def addSuccess(self, *args: Any, **kwargs: Any) -> None: TestResult.addSuccess(self, *args, **kwargs) @@ -181,7 +181,7 @@ class TextTestResult(runner.TextTestResult): self.stream.writeln("** Skipping {}: {}".format( # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139 full_test_name(test), reason)) - self.stream.flush() # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139 + self.stream.flush() class RemoteTestResult(django_runner.RemoteTestResult): """