Skip to content

Commit 4c141c5

Browse files
committed
moving fixtures into conftest.py
1 parent 94ff15f commit 4c141c5

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
3+
def pytest_addoption(parser):
4+
"""Add CLI options to pytest."""
5+
parser.addoption(
6+
"--risk",
7+
nargs="?",
8+
choices=["stable", "candidate", "beta", "edge"],
9+
const="stable",
10+
default="stable",
11+
type=str,
12+
help="Risk to be used when deploying the terraform module",
13+
)
14+
15+
@pytest.fixture(scope="module")
16+
def risk(request) -> str:
17+
"""The risk to be used when deploying the terraform module."""
18+
return request.config.getoption("--risk") or "stable"

modules/kubeflow-mlflow/tests/test_deployment.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ def lightkube_client() -> lightkube.Client:
1414
client = lightkube.Client(field_manager="kubeflow")
1515
return client
1616

17-
def pytest_addoption(parser):
18-
"""Add CLI options to pytest."""
19-
parser.addoption(
20-
"--risk",
21-
nargs="?",
22-
choices=["stable", "candidate", "beta", "edge"],
23-
const="stable",
24-
default="stable",
25-
type=str,
26-
help="Risk to be used when deploying the terraform module",
27-
)
28-
29-
@pytest.fixture(scope="module")
30-
def risk(request) -> str:
31-
"""The risk to be used when deploying the terraform module."""
32-
return request.config.getoption("--risk") or "stable"
3317

3418
class TestCharm:
3519

0 commit comments

Comments
 (0)