+ return runner.run(suite)
+
+def test_module_name(absolute, runner=None):
+ 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:
+ if yes_no("Run suite {}".format(module_name)):
+ gc.collect()
+ test_module_name(module_name)
+
+
+def test_prepare(casetype):
+ case = casetype()
+ case.setUp()
+
+
+def main():
+ import microcontroller.esp8266 # temporary workaround for stack recursion error
+ moduleNames = ["testing.implementation.all.digitalio",]
+ 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