def app(): print("APP FIXTURE") test_app = create_app(env="testing") # Establish an application context before running the tests. ctx = test_app.app_context() ctx.push() yield test_app ctx.pop() print("DONE WITH APP FIXTURE")
from flexmeasures.app import create as create_app from flexmeasures.utils import config_defaults """ Run the FlexMeasures application locally. Best to use in a development setup. A professional web server should be handed the app object to use in a WSGI context. """ if __name__ == "__main__": print("Starting the FlexMeasures Platform ...") create_app().run(debug=config_defaults.DevelopmentConfig.DEBUG, load_dotenv=False)
# If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys from datetime import datetime from humanize import naturaldelta from flexmeasures.app import create as create_app from flexmeasures.ui.utils.view_utils import get_git_description sys.path.insert(0, os.path.abspath("..")) flexmeasures_app = create_app() # -- Project information ----------------------------------------------------- project = flexmeasures_app.config.get("FLEXMEASURES_PLATFORM_NAME") copyright = f"{datetime.now().year}, Seita Energy Flexibility, developed in partnership with A1 Engineering, South Korea" author = "Seita B.V." # The short X.Y version git_version, git_commits_since, git_hash = get_git_description() version = f"{git_version} + {git_commits_since} commits (revision {git_hash})" # The full version, including alpha/beta/rc tags release = version rst_prolog = f""" .. |FLEXMEASURES_PLATFORM_NAME| replace:: {flexmeasures_app.config.get("FLEXMEASURES_PLATFORM_NAME")}
from flexmeasures.app import create as create_app application = create_app()