test_runner: Remove unused type: ignore comments.

Also enable warn_unused_ignores.  I think the fact that there are so
few of these is good evidence that it’s not a significant burden for
people fixing type errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-16 14:33:26 -07:00
committed by Tim Abbott
parent 30ab0524b5
commit 95c6d44a4a
2 changed files with 5 additions and 8 deletions

View File

@@ -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:

View File

@@ -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):
"""