import cherrypy
from mgr_module import MgrModule
+if 'COVERAGE_ENABLED' in os.environ:
+ import coverage
+ _cov = coverage.Coverage(config_file="{}/.coveragerc".format(os.path.dirname(__file__)))
+ _cov.start()
+
+# pylint: disable=wrong-import-position
from .controllers.auth import Auth
from .tools import load_controllers, json_error_page, SessionExpireAtBrowserCloseTool, \
NotificationQueue
cherrypy.tree.mount(Module.StaticRoot(), '/', config=config)
def serve(self):
+ if 'COVERAGE_ENABLED' in os.environ:
+ _cov.start()
self.configure_cherrypy()
cherrypy.engine.start()
logger.info('Waiting for engine...')
self.log.info('Waiting for engine...')
cherrypy.engine.block()
+ if 'COVERAGE_ENABLED' in os.environ:
+ _cov.stop()
+ _cov.save()
logger.info('Engine done')
def shutdown(self):