preventing this message:
/usr/lib/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
warnings.warn("TestResult has no addDuration method",
as far as I can tell we have no real use for addDuration, since we
already measure time in other ways.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
self._stream.write("test: " + test.id() + "\n")
self._stream.flush()
+ def addDuration(self, *args):
+ pass
+
def stopTest(self, test):
"""Mark a test as having finished its test run."""
super().stopTest(test)
self._time = a_datetime
return self.decorated.time(a_datetime)
+ def addDuration(self, *args):
+ pass
+
class SubunitTestRunner(object):
class TestsuiteEnabledTestResult(unittest.TestResult):
+ def addDuration(self, *args):
+ pass
+
def start_testsuite(self, name):
raise NotImplementedError(self.start_testsuite)
def _add_prefix(self, test):
return subunit.RemotedTestCase(self.prefix + test.id() + self.suffix)
+ def addDuration(self, *args):
+ pass
+
def addError(self, test, err=None):
test = self._add_prefix(test)
self.error_added += 1