def main(): """ Main entry point for the application. Runs the command parsed from the CLI using the argparse func system """ # Exception raised on exit due to threading module loading before gevent # This preemptive patching prevents this # see: http://stackoverflow.com/questions/8774958/keyerror-in-module-threading-after-a-successful-py-test-run import sys if 'threading' in sys.modules: del sys.modules['threading'] import gevent import gevent.monkey gevent.monkey.patch_all() # Setup logger & config from tranny.app import config # Execute the user command arguments = parse_args() try: if arguments.loglevel: log_level = arguments.loglevel.upper() elif config.has_option("log", "level"): log_level = config.get_default("log", "level") else: log_level = "INFO" setup_logging(config, log_level) if arguments.config: config.initialize(arguments.config) arguments.func(arguments) except Exception: logging.exception("Fatal error, cannot start!") sys.exit(1) else: sys.exit(0)
def __init__(self, methodName='runTest'): super(TrannyTestCase, self).__init__(methodName=methodName) self.client_name = '' config.initialize()
def reload(self): self._updater.kill() config.initialize()