mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
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:
committed by
Tim Abbott
parent
30ab0524b5
commit
95c6d44a4a
5
mypy.ini
5
mypy.ini
@@ -14,14 +14,11 @@ disallow_any_generics = True
|
|||||||
warn_no_return = True
|
warn_no_return = True
|
||||||
no_implicit_optional = True
|
no_implicit_optional = True
|
||||||
warn_redundant_casts = True
|
warn_redundant_casts = True
|
||||||
|
warn_unused_ignores = True
|
||||||
|
|
||||||
# Display the codes needed for # type: ignore[code] annotations.
|
# Display the codes needed for # type: ignore[code] annotations.
|
||||||
show_error_codes = True
|
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
|
# 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
|
# well as a handful of our own modules that we haven't told mypy how
|
||||||
# to find. Ignore them. (For some details, see:
|
# to find. Ignore them. (For some details, see:
|
||||||
|
|||||||
@@ -152,8 +152,8 @@ class TextTestResult(runner.TextTestResult):
|
|||||||
self.failed_tests: List[str] = []
|
self.failed_tests: List[str] = []
|
||||||
|
|
||||||
def addInfo(self, test: TestCase, msg: str) -> None:
|
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.write(msg)
|
||||||
self.stream.flush() # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139
|
self.stream.flush()
|
||||||
|
|
||||||
def addInstrumentation(self, test: TestCase, data: Dict[str, Any]) -> None:
|
def addInstrumentation(self, test: TestCase, data: Dict[str, Any]) -> None:
|
||||||
append_instrumentation_data(data)
|
append_instrumentation_data(data)
|
||||||
@@ -161,7 +161,7 @@ class TextTestResult(runner.TextTestResult):
|
|||||||
def startTest(self, test: TestCase) -> None:
|
def startTest(self, test: TestCase) -> None:
|
||||||
TestResult.startTest(self, test)
|
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.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:
|
def addSuccess(self, *args: Any, **kwargs: Any) -> None:
|
||||||
TestResult.addSuccess(self, *args, **kwargs)
|
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
|
self.stream.writeln("** Skipping {}: {}".format( # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139
|
||||||
full_test_name(test),
|
full_test_name(test),
|
||||||
reason))
|
reason))
|
||||||
self.stream.flush() # type: ignore[attr-defined] # https://github.com/python/typeshed/issues/3139
|
self.stream.flush()
|
||||||
|
|
||||||
class RemoteTestResult(django_runner.RemoteTestResult):
|
class RemoteTestResult(django_runner.RemoteTestResult):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user