-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
micropython-lib/unittest/unittest.py
Lines 197 to 219 in 9e21d6e
except: | |
print(" FAIL") | |
test_result.failuresNum += 1 | |
# Uncomment to investigate failure in detail | |
#raise | |
continue | |
finally: | |
tear_down() | |
def main(module="__main__"): | |
def test_cases(m): | |
for tn in dir(m): | |
c = getattr(m, tn) | |
if isinstance(c, object) and isinstance(c, type) and issubclass(c, TestCase): | |
yield c | |
m = __import__(module) | |
suite = TestSuite() | |
for c in test_cases(m): | |
suite.addTest(c) | |
runner = TestRunner() | |
result = runner.run(suite) |
However, original implementation of unittest
module takes care about failures:
def runTests(self):
if self.testRunner is None:
self.testRunner = TextTestRunner(verbosity=self.verbosity)
result = self.testRunner.run(self.test)
sys.exit(not result.wasSuccessful())
Unfortunately, micropython
version doesn't.
Therefore it is unable to build CI for micropython - it will be always passing.
P.S. Fix is very straight forward - just add check for failures.
Metadata
Metadata
Assignees
Labels
No labels