Skip to content

Commit

Permalink
composition test: Rescoped site fixtures
Browse files Browse the repository at this point in the history
Change-Id: I23d0b5c92215cb8c3d6561f2f294f5913d56e9fe
  • Loading branch information
rene-slowenski-checkmk committed Aug 23, 2024
1 parent 4f247b6 commit 764975f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/composition/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# The scope of the site fixtures is "module" to avoid that changing the site properties in a module
# may result in a test failing in another one. It also makes analyzing the job artifacts easier.
@pytest.fixture(name="central_site", scope="module")
@pytest.fixture(name="central_site", scope="session")
def _central_site(request: pytest.FixtureRequest) -> Iterator[Site]:
site_number = len(central_site_ids)
central_site_ids.append(f"{site_number}_central")
Expand All @@ -32,7 +32,7 @@ def _central_site(request: pytest.FixtureRequest) -> Iterator[Site]:
)


@pytest.fixture(name="remote_site", scope="module")
@pytest.fixture(name="remote_site", scope="session")
def _remote_site(central_site: Site, request: pytest.FixtureRequest) -> Iterator[Site]:
site_number = central_site.id.split("_")[1]
remote_site_generator = site_factory.get_test_site(
Expand Down Expand Up @@ -102,7 +102,7 @@ def _add_remote_site_to_central_site(
)


@pytest.fixture(name="installed_agent_ctl_in_unknown_state", scope="module")
@pytest.fixture(name="installed_agent_ctl_in_unknown_state", scope="function")
def _installed_agent_ctl_in_unknown_state(central_site: Site) -> Path:
return install_agent_package(_agent_package_path(central_site))

Expand Down

0 comments on commit 764975f

Please sign in to comment.