import pytest from .mockextensions.app import MockExtensionApp mock_html = """ {% block title %}Jupyter Server 1{% endblock %} {% block meta %} {% endblock %}
{% block site %} {% endblock site %}
{% block after_site %} {% endblock after_site %} """ @pytest.fixture def mock_template(jp_template_dir): index = jp_template_dir.joinpath("index.html") index.write_text(mock_html) @pytest.fixture def extension_manager(jp_serverapp): return jp_serverapp.extension_manager @pytest.fixture def config_file(jp_config_dir): """""" f = jp_config_dir.joinpath("jupyter_mockextension_config.py") f.write_text("c.MockExtensionApp.mock_trait ='config from file'") return f @pytest.fixture(autouse=True) def jp_mockextension_cleanup(): yield MockExtensionApp.clear_instance()