kopia lustrzana https://github.com/micropython/micropython-lib
unittest: TestSuite: Add run() method.
For CPython compatibility. Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>pull/488/head
rodzic
04dce89790
commit
2c0b508e4d
|
@ -195,12 +195,16 @@ class TestSuite:
|
||||||
def addTest(self, cls):
|
def addTest(self, cls):
|
||||||
self._tests.append(cls)
|
self._tests.append(cls)
|
||||||
|
|
||||||
|
def run(self, result):
|
||||||
|
for c in self._tests:
|
||||||
|
result.exceptions.extend(run_suite(c, result))
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
class TestRunner:
|
class TestRunner:
|
||||||
def run(self, suite):
|
def run(self, suite):
|
||||||
res = TestResult()
|
res = TestResult()
|
||||||
for c in suite._tests:
|
suite.run(res)
|
||||||
res.exceptions.extend(run_suite(c, res))
|
|
||||||
|
|
||||||
print("Ran %d tests\n" % res.testsRun)
|
print("Ran %d tests\n" % res.testsRun)
|
||||||
if res.failuresNum > 0 or res.errorsNum > 0:
|
if res.failuresNum > 0 or res.errorsNum > 0:
|
||||||
|
|
Ładowanie…
Reference in New Issue