From aa21e752d4d2dab88fd9fc6dda5aeb3dbbe5d00e Mon Sep 17 00:00:00 2001 From: Shane Kerr Date: Tue, 19 Dec 2023 16:07:04 +0100 Subject: [PATCH] Fix flake8 issues --- .github/workflows/verify.yml | 2 +- ns1/rest/records.py | 2 +- ns1/rest/zones.py | 1 + tests/unit/test_zone.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 0fb3065..025cf4f 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -22,7 +22,7 @@ jobs: run: | # Ignore the line length rule because black will handle that # and flake8 doesn't allow long comment lines. - flake8 . --exclude=.tox --count --show-source --statistics --extend-ignore=E501 + flake8 . --exclude=.tox --exclude=.eggs --count --show-source --statistics --extend-ignore=E501 - name: Lint with black run: | black . --check -l 79 --diff diff --git a/ns1/rest/records.py b/ns1/rest/records.py index f84234b..0baf7fd 100644 --- a/ns1/rest/records.py +++ b/ns1/rest/records.py @@ -4,7 +4,7 @@ # License under The MIT License (MIT). See LICENSE in project root. try: from collections.abc import Iterable -except: +except ImportError: from collections import Iterable import sys diff --git a/ns1/rest/zones.py b/ns1/rest/zones.py index ce833b6..98068b9 100644 --- a/ns1/rest/zones.py +++ b/ns1/rest/zones.py @@ -176,6 +176,7 @@ def delete_version( errback=errback, ) + # successive pages just extend the list of zones def zone_list_pagination(curr_json, next_json): curr_json.extend(next_json) diff --git a/tests/unit/test_zone.py b/tests/unit/test_zone.py index fa8e8df..4ae266a 100644 --- a/tests/unit/test_zone.py +++ b/tests/unit/test_zone.py @@ -108,6 +108,7 @@ def test_rest_zone_version_delete(zones_config, zone, id, url): errback=None ) + def test_rest_zone_buildbody(zones_config): z = ns1.rest.zones.Zones(zones_config) zone = "test.zone"