diff --git a/.travis.yml b/.travis.yml index 5985d65..5aa61b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python python: - - "3.4" - - "3.5" + - "3.8" install: - pip install -U setuptools && pip install tox tox-travis coveralls script: diff --git a/tests/fixtures.py b/tests/fixtures.py index ae21b24..90f0165 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -86,7 +86,7 @@ SERVER_CERT_ZO_NE = MagicMock(name='zo-ne') SERVER_CERT_ZO_NE.server_certificate_metadata = {'Arn': 'arn:aws:123', 'ServerCertificateName': 'zo-ne', - 'Expiration': datetime(2020, 4, 1, 12, 14, 14, + 'Expiration': datetime(2025, 4, 1, 12, 14, 14, tzinfo=timezone(timedelta(hours=2))), 'Path': '/', 'ServerCertificateId': '000', diff --git a/tests/test_cli.py b/tests/test_cli.py index 50fee63..3907b76 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -43,7 +43,7 @@ def test_invalid_definition(): result = runner.invoke(cli, ['print', 'myapp.yaml', '--region=aa-fakeregion-1', '123'], catch_exceptions=False) - assert 'error: invalid value for "definition"' in result.output.lower() + assert 'error: invalid value for' in result.output.lower() def test_file_not_found(): @@ -193,8 +193,7 @@ def test_region_validation(monkeypatch): result = runner.invoke(cli, ['print', 'myapp.yaml', '--region=invalid-region', '123'], catch_exceptions=False) - assert ('Error: Invalid value for "--region": \'invalid-region\'. ' - 'Region must be one of the following AWS regions:' in result.output) + assert ('Region must be one of the following AWS regions:' in result.output) def test_print_replace_mustache(monkeypatch): @@ -1800,7 +1799,7 @@ def test_scale_with_overwriting_zero_minsize(monkeypatch): boto3.describe_auto_scaling_groups.return_value = {'AutoScalingGroups': [group]} monkeypatch.setattr('boto3.client', MagicMock(return_value=boto3)) runner = CliRunner() - result = runner.invoke(cli, ['scale', 'myapp', '1', '2', '--region=aa-fakeregion-1', '--min_size', '1'], + result = runner.invoke(cli, ['scale', 'myapp', '1', '2', '--region=aa-fakeregion-1', '--min-size', '1'], catch_exceptions=False) assert 'Scaling myasg from 0 to 2 instances' in result.output @@ -1816,7 +1815,7 @@ def test_scale_desired_capacity_smaller_than_min_size(monkeypatch): boto3.describe_auto_scaling_groups.return_value = {'AutoScalingGroups': [group]} monkeypatch.setattr('boto3.client', MagicMock(return_value=boto3)) runner = CliRunner() - result = runner.invoke(cli, ['scale', 'myapp', '1', '2', '--region=aa-fakeregion-1', '--min_size', '4'], + result = runner.invoke(cli, ['scale', 'myapp', '1', '2', '--region=aa-fakeregion-1', '--min-size', '4'], catch_exceptions=False) assert 'Desired capacity must be bigger than specified min_size value' in result.output diff --git a/tests/test_elastigroup_api.py b/tests/test_elastigroup_api.py index ab457a4..5bf4fcc 100644 --- a/tests/test_elastigroup_api.py +++ b/tests/test_elastigroup_api.py @@ -213,5 +213,5 @@ def test_get_spotinst_account_data_failure(): with mock.patch('boto3.client') as MockHelper: MockHelper.return_value.get_template.return_value = template - with raises(click.Abort, message="Expecting click.Abort error"): + with raises(click.Abort): get_spotinst_account_data('fake-region', 'fake-stack-name') diff --git a/tests/test_error_handling.py b/tests/test_error_handling.py index a08b403..62dfc89 100644 --- a/tests/test_error_handling.py +++ b/tests/test_error_handling.py @@ -266,7 +266,7 @@ def test_unknown_error_show_stacktrace(mock_tempfile, mock_raven): senza.error_handling.sentry = senza.error_handling.setup_sentry("test") senza.error_handling.HandleExceptions.stacktrace_visible = True func = MagicMock(side_effect=Exception("something")) - with raises(Exception, message="something"): + with raises(Exception): senza.error_handling.HandleExceptions(func)() mock_tempfile.assert_not_called()