def start_loader_library(self): """ Sets up the loader library and then start it. """ try: self.loader = setup_loader() except Exception as e: print(f"Error starting the gateway: {e}") print("--------------------------------------------------------") print(f"{sys.exc_info()}") print("---------------==(Traceback)==--------------------------") print(f"{traceback.print_exc(file=sys.stdout)}") print("--------------------------------------------------------") yield self.loader.start_the_gateway()
def start_loader_library(self): """ Sets up the loader library and then start it. """ self.loader = setup_loader() yield self.loader.start()
import pyximport; pyximport.install() from unittest import TestCase, result from unittest.case import _AssertRaisesContext import sys from yombo.lib.loader import setup_loader, get_loader setup_loader(testing=True) _loader = get_loader() _loader.import_libraries() #_getComponent = getComponent class ExpectingTestCase(TestCase): def run(self, result=None): self._result = result self._num_expectations = 0 super(ExpectingTestCase, self).run(result) def _fail(self, failure): try: raise failure except failure.__class__: self._result.addFailure(self, sys.exc_info()) def expectRaises(self, excClass, callableObj=None, *args, **kwargs): context = _AssertRaisesContext(excClass, self) if callableObj is None: return context with context: callableObj(*args, **kwargs)