Skip to content

Commit

Permalink
Upgrade black and use python 3.8 in TravisCI (#301)
Browse files Browse the repository at this point in the history
* Upgrade black and use python 3.8

* Upgrade to using python 3.8 in travis
  • Loading branch information
ajvb authored Jun 25, 2020
1 parent 1b254f2 commit fafff36
Show file tree
Hide file tree
Showing 33 changed files with 8 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/python/black
rev: 18.6b4
rev: 19.10b0
hooks:
- id: black
language_version: python3.6
language_version: python3.8
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "3.6"
- "3.8"
sudo: required

before_install:
Expand Down
2 changes: 0 additions & 2 deletions aws/ec2/test_ec2_security_group_opens_all_ports_to_all.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import pytest

from aws.ec2.helpers import (
Expand Down
2 changes: 0 additions & 2 deletions aws/ec2/test_ec2_security_group_opens_all_ports_to_self.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import pytest

from aws.ec2.helpers import (
Expand Down
2 changes: 0 additions & 2 deletions aws/iam/meta_test_resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from dateutil.parser import parse

from aws.iam.resources import iam_users, iam_inline_policies
Expand Down
8 changes: 2 additions & 6 deletions aws/iam/test_iam_admin_user_with_access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ def test_iam_admin_user_with_access_key(iam_admin_user):
"""
assert (
iam_admin_user["CredentialReport"]["access_key_1_active"] != "true"
), "Access key found for admin user: {}".format(
iam_admin_user["UserName"]
)
), "Access key found for admin user: {}".format(iam_admin_user["UserName"])
assert (
iam_admin_user["CredentialReport"]["access_key_2_active"] != "true"
), "Access key found for admin user: {}".format(
iam_admin_user["UserName"]
)
), "Access key found for admin user: {}".format(iam_admin_user["UserName"])
2 changes: 0 additions & 2 deletions aws/rds/resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from conftest import botocore_client


Expand Down
1 change: 0 additions & 1 deletion aws/rds/test_rds_db_instance_backup_enabled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.rds.resources import rds_db_instances_with_tags
Expand Down
1 change: 0 additions & 1 deletion aws/rds/test_rds_db_instance_is_multiaz.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.rds.resources import rds_db_instances_with_tags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import datetime
from botocore.utils import parse_timestamp

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.rds.resources import rds_db_instances_with_tags
Expand Down
2 changes: 0 additions & 2 deletions aws/redshift/resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from conftest import botocore_client


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import pytest

from aws.redshift.resources import redshift_cluster_security_groups
Expand Down
2 changes: 0 additions & 2 deletions aws/s3/resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from conftest import botocore_client


Expand Down
1 change: 0 additions & 1 deletion aws/s3/test_s3_bucket_cors_disabled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.s3.resources import s3_buckets, s3_buckets_cors_rules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import json

import pytest
Expand Down
1 change: 0 additions & 1 deletion aws/s3/test_s3_bucket_logging_enabled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.s3.resources import s3_buckets, s3_buckets_logging
Expand Down
1 change: 0 additions & 1 deletion aws/s3/test_s3_bucket_no_world_acl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.s3.resources import s3_buckets, s3_buckets_acls
Expand Down
1 change: 0 additions & 1 deletion aws/s3/test_s3_bucket_versioning_enabled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.s3.resources import s3_buckets, s3_buckets_versioning
Expand Down
1 change: 0 additions & 1 deletion aws/s3/test_s3_bucket_versioning_mfa_delete_enabled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.s3.resources import s3_buckets, s3_buckets_versioning
Expand Down
1 change: 0 additions & 1 deletion aws/s3/test_s3_bucket_web_hosting_disabled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from aws.s3.resources import s3_buckets, s3_buckets_website
Expand Down
1 change: 0 additions & 1 deletion cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

"""
Patch for pytest cache to serialize datetime.datetime
"""
Expand Down
2 changes: 0 additions & 2 deletions exemptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from collections import defaultdict
from datetime import date
import re
Expand Down
4 changes: 1 addition & 3 deletions gcp/iam/test_only_allowed_org_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ def test_only_allowed_org_accounts(iam_binding, allowed_org_domains):
if not member.startswith("serviceAccount"):
assert (
member.split("@")[-1] in allowed_org_domains
), "{} was found and is not in the allowed_org_domains".format(
member
)
), "{} was found and is not in the allowed_org_domains".format(member)
4 changes: 1 addition & 3 deletions gcp/sql/test_sql_instance_private_ip_required.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ def test_sql_instance_private_ip_required(sql_instance):
assert (
sql_instance.get("settings").get("ipConfiguration").get("ipv4Enabled", None)
== False
), "CloudSQL Instance {0[name]} has a public IPv4 enabled.".format(
sql_instance
)
), "CloudSQL Instance {0[name]} has a public IPv4 enabled.".format(sql_instance)
1 change: 0 additions & 1 deletion heroku/resources.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from conftest import heroku_client


Expand Down
2 changes: 0 additions & 2 deletions meta_test_cache.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from datetime import datetime
from dateutil.parser import parse

Expand Down
2 changes: 0 additions & 2 deletions pagerduty/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from pagerduty.resources import alternate_usernames


Expand Down
2 changes: 0 additions & 2 deletions pagerduty/resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import functools
import json
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import pytest

from pagerduty.helpers import alternate_names_for_user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@


import pytest
from aws.iam.resources import get_all_users_that_can_access_aws_account
from pagerduty.helpers import alternate_names_for_user
from pagerduty.resources import (
users_with_remote_access_escalation_policy_and_extension_configured
users_with_remote_access_escalation_policy_and_extension_configured,
)


Expand Down
1 change: 0 additions & 1 deletion regressions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from collections import defaultdict
import re
import warnings
Expand Down
2 changes: 0 additions & 2 deletions severity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from collections import defaultdict
import warnings

Expand Down

0 comments on commit fafff36

Please sign in to comment.