Skip to content

Commit

Permalink
test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcapet committed Feb 23, 2023
1 parent 08716ee commit 02b8b6f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ dnspython>=1.15.0
stups-pierone>=1.0.34
boto3>=1.3.0
botocore>=1.4.10
pytest>=3.6.3
pytest>=6.2.0
raven
typing
15 changes: 8 additions & 7 deletions tests/fixtures.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,11 @@ def disable_version_check(monkeypatch):
monkeypatch.setattr('senza.subcommands.root.check_senza_version', m)


@pytest.fixture(autouse=True)
def valid_regions(monkeypatch):
m_session = MagicMock()
m_session.return_value = m_session
m_session.get_available_regions.return_value = ['aa-fakeregion-1']
monkeypatch.setattr('boto3.session.Session', m_session)
return m_session
@pytest.fixture(autouse=True, scope="session")
def valid_regions():
with pytest.MonkeyPatch.context() as monkeypatch:
m_session = MagicMock()
m_session.return_value = m_session
m_session.get_available_regions.return_value = ['aa-fakeregion-1']
monkeypatch.setattr('boto3.session.Session', m_session)
yield m_session
5 changes: 2 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
from senza.subcommands.root import cli
from senza.traffic import PERCENT_RESOLUTION, StackVersion

from fixtures import (HOSTED_ZONE_EXAMPLE_NET, # noqa: F401
HOSTED_ZONE_EXAMPLE_ORG, boto_client, boto_resource,
disable_version_check, valid_regions)
from conftest import (HOSTED_ZONE_EXAMPLE_NET, # noqa: F401
HOSTED_ZONE_EXAMPLE_ORG)


def test_invalid_definition():
Expand Down
3 changes: 1 addition & 2 deletions tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
from senza.components.weighted_dns_elastic_load_balancer_v2 import \
component_weighted_dns_elastic_load_balancer_v2

from fixtures import (HOSTED_ZONE_ZO_NE_COM, HOSTED_ZONE_ZO_NE_DEV, # noqa: F401
boto_resource, boto_client)
from conftest import (HOSTED_ZONE_ZO_NE_COM, HOSTED_ZONE_ZO_NE_DEV) # noqa: F401


def test_invalid_component():
Expand Down
2 changes: 0 additions & 2 deletions tests/test_subcommands/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from senza.cli import cli
from senza.subcommands.config import configuration

from fixtures import disable_version_check # noqa: F401


def create_config(app_dir):
configuration.config_path = Path(app_dir) / 'config.yaml'
Expand Down
2 changes: 0 additions & 2 deletions tests/test_subcommands/test_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from requests.exceptions import HTTPError, Timeout
from senza.subcommands.root import check_senza_version, cli

from fixtures import disable_version_check # noqa: F401


@fixture()
def mock_get_app_dir(monkeypatch):
Expand Down

0 comments on commit 02b8b6f

Please sign in to comment.