Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_cli_entrypoint_print_dependency_versions(monkeypatch: Any, capsys: Any) -> None:
monkeypatch.setattr(logging.root, 'handlers', [])
with pytest.raises(SystemExit):
tomodachi.cli.cli_entrypoint(['tomodachi', '--dependency-versions'])
out, err = capsys.readouterr()
assert err == ''
assert out != 'tomodachi/{}'.format(tomodachi.__version__) + "\n"
import aiobotocore
assert 'aiobotocore/{}'.format(aiobotocore.__version__) + "\n" in out
def main():
epilog = (
f"version info: cowfish/{__version__} aiobotocore/{aiobotocore.__version__}"
)
parser = argparse.ArgumentParser(description=__description__, epilog=epilog)
parser.add_argument("queue_name")
parser.add_argument("region")
parser.add_argument(
"-c", "--concurrency", type=int, default=20, help="default to 20"
)
parser.add_argument(
"-v", "--visibility-timeout", type=int, default=60, help="default to 60"
)
parser.add_argument("--handler", type=str, help="default to rpc_handler")
parser.add_argument(
"--no-batch",
dest="batch",
action="store_false",
default=True,
def test_dependencies(self, fail_on_errors: bool = True, output_versions: bool = False) -> None:
errors = False
try:
import aiobotocore
if output_versions:
print('aiobotocore/{}'.format(aiobotocore.__version__))
except ModuleNotFoundError as e: # pragma: no cover
errors = True
print('Dependency failure: aiobotocore failed to load (error: "{}")'.format(str(e)))
except Exception as e: # pragma: no cover
errors = True
print('Dependency failure: aiobotocore failed to load (error: "{}")'.format(str(e)))
logging.exception('')
print('')
try:
import botocore
if output_versions:
print('botocore/{}'.format(botocore.__version__))
except ModuleNotFoundError as e: # pragma: no cover
errors = True
print('Dependency failure: botocore failed to load (error: "{}")'.format(str(e)))