I am writing some python tests for an embedded system.
I send the device a command to run some feature, while reading result(logs) via serial port.
I would like to compare my expected results to the device output, and check for incorrect behavior of device according to the logs and display the results.
I am looking for a pythonic way to do tests and summarize results. all tests must run even if one failed.
Currently, my code looks something like this :
class TestSpecificDeviceFeature() :
def __init__(self):
self.expectedResults = AllExpectedResultsForRun()
sendCommandtoDevicetoRunFeature()
self.deviceResult = RunDeviceAndCollectOuput()
def test1():
print self.expectedResults.result1 == self.deviceResult.output1
def test2():
print self.expectedResults.result2 == self.deviceResult.output2
...
...
I want to use one of the frameworks(unittest, pytest). Which one will fit better so i don't have to rewrite my code too much?