]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Add keywords arguments to addDuration() method
authorJennifer Sutton <jennifersutton@catalyst.net.nz>
Thu, 2 Apr 2026 03:09:58 +0000 (16:09 +1300)
committerGary Lockyer <gary@samba.org>
Tue, 7 Apr 2026 03:14:34 +0000 (03:14 +0000)
Without these, the type checker complains:

Method "addDuration" overrides class "TestResult" in an incompatible manner.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
python/samba/subunit/run.py
selftest/subunithelper.py

index 39fbfdb09fca7ed4b1a22f27ab270060b9506466..11d47a207c57b40bd582a290870be274d5e934d1 100755 (executable)
@@ -81,7 +81,7 @@ class TestProtocolClient(unittest.TestResult):
         self._stream.write("test: " + test.id() + "\n")
         self._stream.flush()
 
-    def addDuration(self, *args):
+    def addDuration(self, *args, **kwargs):
         pass
 
     def stopTest(self, test):
@@ -457,7 +457,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator):
         self._time = a_datetime
         return self.decorated.time(a_datetime)
 
-    def addDuration(self, *args):
+    def addDuration(self, *args, **kwargs):
         pass
 
 
index 4e1c1752f05e0581f789b91b69063ac140048862..6c47cc3fffaaedce328629f2e994802ba2e9c2c4 100644 (file)
@@ -42,7 +42,7 @@ VALID_RESULTS = set(['success', 'successful', 'failure', 'fail', 'skip',
 
 class TestsuiteEnabledTestResult(unittest.TestResult):
 
-    def addDuration(self, *args):
+    def addDuration(self, *args, **kwargs):
         pass
 
     def start_testsuite(self, name):
@@ -308,7 +308,7 @@ class FilterOps(unittest.TestResult):
     def _add_prefix(self, test):
         return subunit.RemotedTestCase(self.prefix + test.id() + self.suffix)
 
-    def addDuration(self, *args):
+    def addDuration(self, *args, **kwargs):
         pass
 
     def addError(self, test, err=None):