]> Repositories - hackapet/Adafruit_Blinka.git/blobdiff - python/testing/__init__.py
More readable, link to log of example test suite
[hackapet/Adafruit_Blinka.git] / python / testing / __init__.py
index 61a5b137d3c7fb8e34b16335aeb3ed47b4e5ec6d..87e3900c60804d0da629021f4757936fcd243065 100644 (file)
@@ -67,13 +67,16 @@ def test_module(module, runner=None):
     return runner.run(suite)
 
 def test_module_name(absolute, runner=None):
-    print("Testing {}".format(absolute))
-    module=__import__(absolute)
-    relatives = absolute.split(".")
-    if len(relatives) > 1:
-        for relative in relatives[1:]:
-            module = getattr(module, relative)
-    return test_module(module, runner)
+    try:
+        print("Suite begin: {}".format(absolute))
+        module=__import__(absolute)
+        relatives = absolute.split(".")
+        if len(relatives) > 1:
+            for relative in relatives[1:]:
+                module = getattr(module, relative)
+        return test_module(module, runner)
+    finally:
+        print("Suite end: {}".format(absolute))
 
 def test_interactive(*module_names):
     for module_name in module_names:
@@ -93,4 +96,6 @@ def main():
     if agnostic.implementation == "micropython":
         moduleNames.extend([ "testing.implementation.micropython.digitalio",])
 
+    unittest.raiseException = True # terminates with stack information on userspace Exception
+    unittest.raiseBaseException = True # terminates with stack information on system Exception
     test_interactive(*moduleNames)
\ No newline at end of file