Skip to content

Commit

Permalink
Ensure GUI code is loaded during setup of test_theme_request_context_…
Browse files Browse the repository at this point in the history
…integration

Change-Id: Ic6dae6eef1ac8dfe8fd81878c812a1c43d84b610
  • Loading branch information
LarsMichelsen committed Oct 13, 2024
1 parent 3bf4bf9 commit 011f3cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/integration/cmk/gui/utils/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@

import cmk.utils.paths

from cmk.gui import http
from cmk.gui import http, main_modules
from cmk.gui.utils import get_failed_plugins
from cmk.gui.utils.script_helpers import session_wsgi_app
from cmk.gui.utils.theme import Theme, theme


@pytest.fixture(name="load_plugins", scope="session")
def fixture_load_plugins() -> None:
main_modules.load_plugins()
if errors := get_failed_plugins():
raise Exception(f"The following errors occured during plug-in loading: {errors}")


@pytest.fixture(name="request_context")
def request_context() -> Iterator[None]:
def request_context(load_plugins: None) -> Iterator[None]:
"""This fixture registers a global htmllib.html() instance just like the regular GUI"""
flask_app = session_wsgi_app(testing=True)

Expand Down

0 comments on commit 011f3cc

Please sign in to comment.