os.TestResutls: Add method addResults()

Add method addResults(), which allows to merge results of another
TestResults instance into the called instance.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2022-12-09 15:56:05 +01:00
commit d747aa78d5

View file

@ -98,6 +98,9 @@ class TestResults: # export
def add(self, case, phase, result):
self.__records.append([case, phase, result])
def addResults(self, results):
self.__records.extend(results.__records)
def n_failed(self):
return len(list(filter(None, [rec[TestResults.Field.Result] for rec in self.__records])))