Exemplo n.º 1
0
# same name, which leads to a test_name.py and test_name.so
# So we have to do it manually, given the full path

# Slightly different, depending on the test type
if test_ext == ".py":
  m = SourceFileLoader(test_name, full_path).load_module()
else:
  m = ExtensionFileLoader(test_name, full_path).load_module()




# Actually run the test, watching for exceptions
try:
  # Run the test in the module
  ret = m.run_test()
except Exception as e:
  # Printing to pulsar output here so that it doesn't get
  # interleaved with python's output
  out = pulsar.get_global_output()
  out.output("\n")
  out.output("!!! Caught unhandled exception inside a test\n")
  out.output(traceback.format_exc())
  out.output("\n")
  out.flush()
  ret = -1

# Failure is signaled via non-zero exit value
exit(ret)