Skip to content

Commit

Permalink
Update conftest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmateusribeiro committed Jun 1, 2024
1 parent 41941a4 commit 0ba8971
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/step_defs/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def pytest_addoption(parser: 'pytest.Parser') -> None:
"""
parser.addoption("--mock-aws",
action="store",
default=True,
type=bool,
default="True",
choices=["True", "False"],
type=str,
help="Boolean to indicate if AWS should be mocked"
)

Expand All @@ -30,7 +31,9 @@ def mock_aws_flag(request: 'pytest.FixtureRequest') -> bool:
Returns:
bool: Boolean indicating whether AWS should be mocked.
"""
mock_aws_flag = request.config.getoption("--mock-aws")
mock_aws_value = request.config.getoption("--mock-aws")
mock_aws_flag = mock_aws_value == "True"

return mock_aws_flag

@pytest.fixture(scope='module')
Expand Down Expand Up @@ -64,6 +67,8 @@ def setup(request: 'pytest.FixtureRequest', mock_aws_flag: bool, log: CustomLogg
def teardown():
# Teardown mocked AWS environment
mock.stop()

request.addfinalizer(teardown)
else:
# Setup LocalStack environment
log.info("Creating real SQS client")
Expand Down

0 comments on commit 0ba8971

Please sign in to comment.