kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Add simple, non-compliant test runner.
Need to implement importing of __main__ module and/or globals() to write compliant implementation.asyncio-segfault
rodzic
27ec4eb700
commit
1729f1c7fa
|
@ -23,3 +23,15 @@ class TestCase:
|
|||
if isinstance(e, exc):
|
||||
return
|
||||
raise
|
||||
|
||||
|
||||
# Warning: this is not compliant, but at least an example of test
|
||||
# runner until we have globals()
|
||||
def main(test_classes):
|
||||
for c in test_classes:
|
||||
o = c()
|
||||
for name in dir(o):
|
||||
if name.startswith("test"):
|
||||
m = getattr(o, name)
|
||||
m()
|
||||
print(name, "...ok")
|
||||
|
|
Ładowanie…
Reference in New Issue