From 11979aab0146cf35620f0390bcf6921022f7cf0e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 30 Sep 2026 12:11:45 +0100 Subject: [PATCH] typing: TestCase.run can return None Align the type of this with its superclass [1]. Note that we need to maintain the `type: ignore` since the parent class is not generic. [1] https://github.com/python/typeshed/blob/c981c922a/stdlib/unittest/case.pyi#L91 Signed-off-by: Stephen Finucane --- testtools/testcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testtools/testcase.py b/testtools/testcase.py index 9df9ab2a..9edad089 100644 --- a/testtools/testcase.py +++ b/testtools/testcase.py @@ -1062,7 +1062,7 @@ def _report_unexpected_success( self, details=TestCase._report_details(self, details) ) - def run(self, result: TestResult | None = None) -> TestResult: # type: ignore[override] + def run(self, result: TestResult | None = None) -> TestResult | None: # type: ignore[override] self._reset() try: run_test = self.__RunTest(