kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Allow passing module name or instance into unittest.main()
rodzic
d64557a211
commit
a9cd99ce2d
|
@ -219,7 +219,7 @@ def main(module="__main__"):
|
||||||
if isinstance(c, object) and isinstance(c, type) and issubclass(c, TestCase):
|
if isinstance(c, object) and isinstance(c, type) and issubclass(c, TestCase):
|
||||||
yield c
|
yield c
|
||||||
|
|
||||||
m = __import__(module)
|
m = __import__(module) if isinstance(module, str) else module
|
||||||
suite = TestSuite()
|
suite = TestSuite()
|
||||||
for c in test_cases(m):
|
for c in test_cases(m):
|
||||||
suite.addTest(c)
|
suite.addTest(c)
|
||||||
|
|
Ładowanie…
Reference in New Issue