Skip to content

Commit

Permalink
chore(refactor): remove fixtures (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
amandahla authored Oct 22, 2024
1 parent f3c15ec commit 52f91ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 73 deletions.
4 changes: 2 additions & 2 deletions src-docs/user.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Synapse user.
- <b>`password`</b>: users password.
- <b>`access_token`</b>: obtained when the user is registered.

<a href="../src/user.py#L44"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/user.py#L48"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand All @@ -43,7 +43,7 @@ Initialize the User.

---

<a href="../src/user.py#L55"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/user.py#L59"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `username_must_not_be_empty`

Expand Down
71 changes: 0 additions & 71 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,6 @@ async def nginx_integrator_app_fixture(
return app


@pytest_asyncio.fixture(scope="function", name="another_synapse_app")
async def another_synapse_app_fixture(
model: Model, synapse_app: Application, server_name: str, another_server_name: str
):
"""Change server_name."""
# First we guarantee that the first server_name is set
# Then change it.
await synapse_app.set_config({"server_name": server_name})

await model.wait_for_idle()

await synapse_app.set_config({"server_name": another_server_name})

await model.wait_for_idle()

yield synapse_app


@pytest.fixture(scope="module", name="postgresql_app_name")
def postgresql_app_name_app_name_fixture() -> str:
"""Return the name of the postgresql application deployed for tests."""
Expand All @@ -249,59 +231,6 @@ async def postgresql_app_fixture(
yield model.applications.get(postgresql_app_name)


@pytest.fixture(scope="module", name="grafana_app_name")
def grafana_app_name_fixture() -> str:
"""Return the name of the grafana application deployed for tests."""
return "grafana-k8s"


@pytest_asyncio.fixture(scope="module", name="grafana_app")
async def grafana_app_fixture(
ops_test: OpsTest,
model: Model,
grafana_app_name: str,
):
"""Deploy grafana."""
async with ops_test.fast_forward():
app = await model.deploy(
grafana_app_name,
application_name=grafana_app_name,
channel="latest/edge",
trust=True,
)
await model.wait_for_idle(raise_on_blocked=True, status=ACTIVE_STATUS_NAME)

return app


@pytest.fixture(scope="module", name="prometheus_app_name")
def prometheus_app_name_fixture() -> str:
"""Return the name of the prometheus application deployed for tests."""
return "prometheus-k8s"


@pytest_asyncio.fixture(scope="module", name="prometheus_app")
async def deploy_prometheus_fixture(
ops_test: OpsTest,
model: Model,
prometheus_app_name: str,
):
"""Deploy prometheus."""
async with ops_test.fast_forward():
app = await model.deploy(
prometheus_app_name,
application_name=prometheus_app_name,
channel="latest/edge",
trust=True,
)
# Sometimes it comes back after an error.
await model.wait_for_idle(
raise_on_error=False, raise_on_blocked=True, status=ACTIVE_STATUS_NAME
)

return app


@pytest.fixture(scope="module", name="user_username")
def user_username_fixture() -> typing.Generator[str, None, None]:
"""Return the a username to be created for tests."""
Expand Down

0 comments on commit 52f91ee

Please sign in to comment.