def jupyter_app(caplog): """Initialized (but unlaunched) Jupyter app.""" app = JupyterApp.instance() app.log.addHandler(caplog.handler) yield app app.log.removeHandler(caplog.handler) app.clear_instance()
def _data_dir_default(self): app = None try: if JupyterApp.initialized(): app = JupyterApp.instance() except MultipleInstanceError: pass if app is None: # create an app, without the global instance app = JupyterApp() app.initialize(argv=[]) return app.data_dir