Skip to content

Commit

Permalink
move pytest_addoption to the root
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartz committed Apr 26, 2024
1 parent 494cf33 commit e33bb42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
14 changes: 1 addition & 13 deletions tests/charm/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,9 @@
import pytest_asyncio
from juju.application import Application
from juju.model import Model
from pytest import Parser
from pytest_operator.plugin import OpsTest

CHARM_FILE_PARAM = "--charm-file"
FLASK_APP_IMAGE_PARAM = "--repo-policy-compliance-image"


def pytest_addoption(parser: Parser) -> None:
"""Parse additional pytest options.
Args:
parser: Pytest parser.
"""
parser.addoption(CHARM_FILE_PARAM, action="store", help="Charm file to be deployed")
parser.addoption(FLASK_APP_IMAGE_PARAM, action="store", help="Flask app image to be deployed")
from tests.conftest import CHARM_FILE_PARAM, FLASK_APP_IMAGE_PARAM


@pytest.fixture(scope="session", name="github_token")
Expand Down
19 changes: 19 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Fixtures for charm tests."""

from pytest import Parser

CHARM_FILE_PARAM = "--charm-file"
FLASK_APP_IMAGE_PARAM = "--repo-policy-compliance-image"


def pytest_addoption(parser: Parser) -> None:
"""Parse additional pytest options.
Args:
parser: Pytest parser.
"""
parser.addoption(CHARM_FILE_PARAM, action="store", help="Charm file to be deployed")
parser.addoption(FLASK_APP_IMAGE_PARAM, action="store", help="Flask app image to be deployed")

0 comments on commit e33bb42

Please sign in to comment.