Last active
February 24, 2023 10:05
integration_conftest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pytest | |
from cdk.my_service.constants import CONFIGURATION_NAME, ENVIRONMENT, POWER_TOOLS_LOG_LEVEL, POWERTOOLS_SERVICE_NAME, SERVICE_NAME, TABLE_NAME_OUTPUT | |
from tests.utils import get_stack_output | |
@pytest.fixture(scope='module', autouse=True) | |
def init(): | |
os.environ[POWERTOOLS_SERVICE_NAME] = SERVICE_NAME | |
os.environ[POWER_TOOLS_LOG_LEVEL] = 'DEBUG' | |
os.environ['REST_API'] = 'https://www.ranthebuilder.cloud/api' | |
os.environ['ROLE_ARN'] = 'arn:partition:service:region:account-id:resource-type:resource-id' | |
os.environ['CONFIGURATION_APP'] = SERVICE_NAME | |
os.environ['CONFIGURATION_ENV'] = ENVIRONMENT | |
os.environ['CONFIGURATION_NAME'] = CONFIGURATION_NAME | |
os.environ['CONFIGURATION_MAX_AGE_MINUTES'] = '5' | |
os.environ['AWS_DEFAULT_REGION'] = 'us-east-1' # used for appconfig mocked boto calls | |
os.environ['TABLE_NAME'] = get_stack_output(TABLE_NAME_OUTPUT) | |
@pytest.fixture(scope='module', autouse=True) | |
def table_name(): | |
return os.environ['TABLE_NAME'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment