From: Nicki Křížek Date: Wed, 21 Jan 2026 21:31:15 +0000 (+0100) Subject: Apply black formatting changes X-Git-Tag: v9.21.18~19^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb6d7a0fc3348d391f7215795b5ef0e7a90912b4;p=thirdparty%2Fbind9.git Apply black formatting changes Generated by black 26.1.0 which got updated in CI. --- diff --git a/bin/tests/system/bailiwick/ans1/ans.py b/bin/tests/system/bailiwick/ans1/ans.py index f0b152ac3d7..859e77491f0 100644 --- a/bin/tests/system/bailiwick/ans1/ans.py +++ b/bin/tests/system/bailiwick/ans1/ans.py @@ -24,7 +24,6 @@ from isctest.asyncserver import ( from bailiwick_ans import ResponseSpoofer, spoofing_server - ATTACKER_IP = "10.53.0.3" TTL = 3600 diff --git a/bin/tests/system/bailiwick/ans2/ans.py b/bin/tests/system/bailiwick/ans2/ans.py index 1a9be3d931e..151a2c6ccce 100644 --- a/bin/tests/system/bailiwick/ans2/ans.py +++ b/bin/tests/system/bailiwick/ans2/ans.py @@ -24,7 +24,6 @@ from isctest.asyncserver import ( from bailiwick_ans import ResponseSpoofer, spoofing_server - ATTACKER_IP = "10.53.0.3" TTL = 3600 diff --git a/bin/tests/system/checkds/tests_checkds.py b/bin/tests/system/checkds/tests_checkds.py index 9cf46a3843d..26265ad6127 100755 --- a/bin/tests/system/checkds/tests_checkds.py +++ b/bin/tests/system/checkds/tests_checkds.py @@ -28,7 +28,6 @@ import dns.rcode import dns.rdataclass import dns.rdatatype - pytestmark = [ pytest.mark.skipif( sys.version_info < (3, 7), reason="Python >= 3.7 required [GL #3001]" diff --git a/bin/tests/system/cipher-suites/tests_cipher_suites.py b/bin/tests/system/cipher-suites/tests_cipher_suites.py index 782a24509f9..4b2ba075187 100644 --- a/bin/tests/system/cipher-suites/tests_cipher_suites.py +++ b/bin/tests/system/cipher-suites/tests_cipher_suites.py @@ -18,7 +18,6 @@ import dns.message import isctest import isctest.mark - pytestmark = pytest.mark.extra_artifacts( [ "ns*/example*.db", diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 3a46f4d492d..5daf4f908ff 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -26,7 +26,6 @@ pytest.register_assert_rewrite("isctest") import isctest from isctest.vars.build import SYSTEM_TEST_DIR_GIT_PATH - # Silence warnings caused by passing a pytest fixture to another fixture. # pylint: disable=redefined-outer-name diff --git a/bin/tests/system/dnssec/tests_badkey.py b/bin/tests/system/dnssec/tests_badkey.py index ca80734d4d7..d7dffca0c2b 100644 --- a/bin/tests/system/dnssec/tests_badkey.py +++ b/bin/tests/system/dnssec/tests_badkey.py @@ -16,7 +16,6 @@ import pytest import isctest from isctest.util import param - pytestmark = pytest.mark.extra_artifacts( [ "*/K*", diff --git a/bin/tests/system/dnssec/tests_delv.py b/bin/tests/system/dnssec/tests_delv.py index 436c869d869..9de2252d099 100644 --- a/bin/tests/system/dnssec/tests_delv.py +++ b/bin/tests/system/dnssec/tests_delv.py @@ -17,7 +17,6 @@ import pytest import isctest - pytestmark = pytest.mark.extra_artifacts( [ "*/K*", diff --git a/bin/tests/system/dnssec/tests_policy.py b/bin/tests/system/dnssec/tests_policy.py index 28612b3a484..06ec229b31f 100644 --- a/bin/tests/system/dnssec/tests_policy.py +++ b/bin/tests/system/dnssec/tests_policy.py @@ -18,7 +18,6 @@ import pytest import isctest - pytestmark = pytest.mark.extra_artifacts( [ "*/K*", diff --git a/bin/tests/system/dnssec/tests_signing.py b/bin/tests/system/dnssec/tests_signing.py index 01ccff164c6..8ed481025ac 100644 --- a/bin/tests/system/dnssec/tests_signing.py +++ b/bin/tests/system/dnssec/tests_signing.py @@ -23,7 +23,6 @@ import pytest from isctest.kasp import SettimeOptions import isctest - pytestmark = pytest.mark.extra_artifacts( [ "*/K*", diff --git a/bin/tests/system/dnssec/tests_tat.py b/bin/tests/system/dnssec/tests_tat.py index 6fdfe36992a..2afff050aea 100644 --- a/bin/tests/system/dnssec/tests_tat.py +++ b/bin/tests/system/dnssec/tests_tat.py @@ -18,7 +18,6 @@ import pytest import isctest - pytestmark = pytest.mark.extra_artifacts( [ "*/K*", diff --git a/bin/tests/system/dnssec/tests_validation.py b/bin/tests/system/dnssec/tests_validation.py index 9a74873392f..c713d3a6b25 100644 --- a/bin/tests/system/dnssec/tests_validation.py +++ b/bin/tests/system/dnssec/tests_validation.py @@ -23,7 +23,6 @@ import isctest import isctest.mark from isctest.util import param - pytestmark = pytest.mark.extra_artifacts( [ "*/K*", diff --git a/bin/tests/system/ecdsa/tests_ecdsa.py b/bin/tests/system/ecdsa/tests_ecdsa.py index e0379f79f16..08b4ee0e685 100644 --- a/bin/tests/system/ecdsa/tests_ecdsa.py +++ b/bin/tests/system/ecdsa/tests_ecdsa.py @@ -16,7 +16,6 @@ import dns.flags import isctest - pytestmark = pytest.mark.extra_artifacts( [ "ns*/trusted.conf", diff --git a/bin/tests/system/fetchlimit/tests_sh_fetchlimit.py b/bin/tests/system/fetchlimit/tests_sh_fetchlimit.py index b996c60aa8e..23076980b5d 100644 --- a/bin/tests/system/fetchlimit/tests_sh_fetchlimit.py +++ b/bin/tests/system/fetchlimit/tests_sh_fetchlimit.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "dig.out.*", diff --git a/bin/tests/system/filters/common.py b/bin/tests/system/filters/common.py index 4944775ed13..e5ff22e9772 100644 --- a/bin/tests/system/filters/common.py +++ b/bin/tests/system/filters/common.py @@ -14,7 +14,6 @@ from dns import rdataclass, rdatatype import isctest - ARTIFACTS = [ "conf/*.conf", "ns*/trusted.conf", diff --git a/bin/tests/system/filters/tests_filter_a_v4.py b/bin/tests/system/filters/tests_filter_a_v4.py index 0e143467df7..cb690eb3528 100644 --- a/bin/tests/system/filters/tests_filter_a_v4.py +++ b/bin/tests/system/filters/tests_filter_a_v4.py @@ -20,7 +20,6 @@ from filters.common import ( prime_cache, ) - pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/filters/tests_filter_a_v6.py b/bin/tests/system/filters/tests_filter_a_v6.py index 8ce36974e26..1d33f2fd057 100644 --- a/bin/tests/system/filters/tests_filter_a_v6.py +++ b/bin/tests/system/filters/tests_filter_a_v6.py @@ -20,7 +20,6 @@ from filters.common import ( prime_cache, ) - pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/filters/tests_filter_aaaa_v4.py b/bin/tests/system/filters/tests_filter_aaaa_v4.py index 5a78714e241..3c783a9cf32 100644 --- a/bin/tests/system/filters/tests_filter_aaaa_v4.py +++ b/bin/tests/system/filters/tests_filter_aaaa_v4.py @@ -21,7 +21,6 @@ from filters.common import ( prime_cache, ) - pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/filters/tests_filter_aaaa_v6.py b/bin/tests/system/filters/tests_filter_aaaa_v6.py index f4dbc70fcd6..b973724e145 100644 --- a/bin/tests/system/filters/tests_filter_aaaa_v6.py +++ b/bin/tests/system/filters/tests_filter_aaaa_v6.py @@ -20,7 +20,6 @@ from filters.common import ( prime_cache, ) - pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/filters/tests_filter_checkconf.py b/bin/tests/system/filters/tests_filter_checkconf.py index 17dbdb989ac..de5eae132fd 100644 --- a/bin/tests/system/filters/tests_filter_checkconf.py +++ b/bin/tests/system/filters/tests_filter_checkconf.py @@ -19,7 +19,6 @@ import isctest from filters.common import ARTIFACTS - pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/filters/tests_filter_dns64.py b/bin/tests/system/filters/tests_filter_dns64.py index 218b834682f..39c0bbc603f 100644 --- a/bin/tests/system/filters/tests_filter_dns64.py +++ b/bin/tests/system/filters/tests_filter_dns64.py @@ -15,7 +15,6 @@ import isctest from filters.common import ARTIFACTS - pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/forward/tests_sh_forward.py b/bin/tests/system/forward/tests_sh_forward.py index 0d30b8c3ad3..6f230e93cab 100644 --- a/bin/tests/system/forward/tests_sh_forward.py +++ b/bin/tests/system/forward/tests_sh_forward.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "dig.out.*", diff --git a/bin/tests/system/glue/tests_glue.py b/bin/tests/system/glue/tests_glue.py index b015f56f236..93b0164c39b 100644 --- a/bin/tests/system/glue/tests_glue.py +++ b/bin/tests/system/glue/tests_glue.py @@ -16,7 +16,6 @@ import pytest import isctest - pytestmark = pytest.mark.extra_artifacts( [ "ns1/*", diff --git a/bin/tests/system/hooks/tests_hooks.py b/bin/tests/system/hooks/tests_hooks.py index e50720f218e..87ad1de89d6 100644 --- a/bin/tests/system/hooks/tests_hooks.py +++ b/bin/tests/system/hooks/tests_hooks.py @@ -17,7 +17,6 @@ import dns import pytest import isctest - pytestmark = pytest.mark.extra_artifacts(["conf/*.conf"]) diff --git a/bin/tests/system/isctest/__main__.py b/bin/tests/system/isctest/__main__.py index d1be74c7272..3055c89d799 100644 --- a/bin/tests/system/isctest/__main__.py +++ b/bin/tests/system/isctest/__main__.py @@ -14,7 +14,6 @@ import logging from . import log from .vars import ALL, init_vars - if __name__ == "__main__": # use root logger as fallback - we're not interested in proper logs here log.basic.LOGGERS["conftest"] = logging.getLogger() diff --git a/bin/tests/system/isctest/asyncserver.py b/bin/tests/system/isctest/asyncserver.py index add1ab07ba4..165a6db9ded 100644 --- a/bin/tests/system/isctest/asyncserver.py +++ b/bin/tests/system/isctest/asyncserver.py @@ -56,7 +56,6 @@ import dns.tsig import dns.version import dns.zone - _UdpHandler = Callable[ [bytes, Tuple[str, int], asyncio.DatagramTransport], Coroutine[Any, Any, None] ] diff --git a/bin/tests/system/isctest/log/basic.py b/bin/tests/system/isctest/log/basic.py index 3474f1b4433..812e83e2544 100644 --- a/bin/tests/system/isctest/log/basic.py +++ b/bin/tests/system/isctest/log/basic.py @@ -14,7 +14,6 @@ from pathlib import Path import textwrap from typing import Dict, Optional - LOG_FORMAT = "%(asctime)s %(levelname)7s:%(name)s %(message)s" LOG_INDENT = 4 diff --git a/bin/tests/system/isctest/log/watchlog.py b/bin/tests/system/isctest/log/watchlog.py index 447879662a0..d7154995b7d 100644 --- a/bin/tests/system/isctest/log/watchlog.py +++ b/bin/tests/system/isctest/log/watchlog.py @@ -17,7 +17,6 @@ import time from isctest.text import compile_pattern, FlexPattern, LineReader - T = TypeVar("T") OneOrMore = Union[T, List[T]] diff --git a/bin/tests/system/isctest/text.py b/bin/tests/system/isctest/text.py index ca3cc835e71..33798c37032 100644 --- a/bin/tests/system/isctest/text.py +++ b/bin/tests/system/isctest/text.py @@ -16,7 +16,6 @@ import re from re import compile as Re from typing import Iterator, List, Match, Optional, Pattern, TextIO, Union - FlexPattern = Union[str, Pattern] diff --git a/bin/tests/system/isctest/vars/build.py b/bin/tests/system/isctest/vars/build.py index e22fb95a0f0..aa251e0e6b3 100644 --- a/bin/tests/system/isctest/vars/build.py +++ b/bin/tests/system/isctest/vars/build.py @@ -12,7 +12,6 @@ from pathlib import Path from typing import Dict - SYSTEM_TEST_DIR_GIT_PATH = "bin/tests/system" diff --git a/bin/tests/system/isctest/vars/features.py b/bin/tests/system/isctest/vars/features.py index 69ecc6786f8..4c47efa00d4 100644 --- a/bin/tests/system/isctest/vars/features.py +++ b/bin/tests/system/isctest/vars/features.py @@ -14,7 +14,6 @@ import subprocess from .basic import BASIC_VARS - FEATURES = { "DNSTAP": "--enable-dnstap", "EXTENDED_DS_DIGEST": "--extended-ds-digest", diff --git a/bin/tests/system/isctest/vars/openssl.py b/bin/tests/system/isctest/vars/openssl.py index 3d1829e7235..52b42ccfd9c 100644 --- a/bin/tests/system/isctest/vars/openssl.py +++ b/bin/tests/system/isctest/vars/openssl.py @@ -15,7 +15,6 @@ from typing import Optional from .. import log - OPENSSL_VARS = { "OPENSSL_CONF": os.getenv("OPENSSL_CONF", None), "SOFTHSM2_CONF": os.getenv("SOFTHSM2_CONF", None), diff --git a/bin/tests/system/keepalive/tests_keepalive.py b/bin/tests/system/keepalive/tests_keepalive.py index d0efc6af542..40f9c4a21b9 100644 --- a/bin/tests/system/keepalive/tests_keepalive.py +++ b/bin/tests/system/keepalive/tests_keepalive.py @@ -12,7 +12,6 @@ import isctest import pytest - pytestmark = pytest.mark.extra_artifacts( ["ns2/named.stats"], ) diff --git a/bin/tests/system/keyfromlabel/tests_keyfromlabel.py b/bin/tests/system/keyfromlabel/tests_keyfromlabel.py index 0eb9370060a..d5c18e4f356 100644 --- a/bin/tests/system/keyfromlabel/tests_keyfromlabel.py +++ b/bin/tests/system/keyfromlabel/tests_keyfromlabel.py @@ -18,7 +18,6 @@ import pytest import isctest.mark - pytestmark = [ isctest.mark.softhsm2_environment, pytest.mark.extra_artifacts( diff --git a/bin/tests/system/nsec3/tests_nsec3_change.py b/bin/tests/system/nsec3/tests_nsec3_change.py index 6da20aaf7ff..860c8d3caf0 100644 --- a/bin/tests/system/nsec3/tests_nsec3_change.py +++ b/bin/tests/system/nsec3/tests_nsec3_change.py @@ -30,7 +30,6 @@ from nsec3.common import ( check_nsec3_case, ) - # include the following zones when rendering named configs ZONES = { "nsec3-change.kasp", diff --git a/bin/tests/system/nsec3/tests_nsec3_initial.py b/bin/tests/system/nsec3/tests_nsec3_initial.py index 9795cf04cb8..038cd144284 100644 --- a/bin/tests/system/nsec3/tests_nsec3_initial.py +++ b/bin/tests/system/nsec3/tests_nsec3_initial.py @@ -28,7 +28,6 @@ from nsec3.common import ( check_nsec3_case, ) - # include the following zones when rendering named configs ZONES = { "nsec-to-nsec3.kasp", diff --git a/bin/tests/system/nsec3/tests_nsec3_reconfig.py b/bin/tests/system/nsec3/tests_nsec3_reconfig.py index dd29443050b..cb75f1caa49 100644 --- a/bin/tests/system/nsec3/tests_nsec3_reconfig.py +++ b/bin/tests/system/nsec3/tests_nsec3_reconfig.py @@ -30,7 +30,6 @@ from nsec3.common import ( check_nsec3_case, ) - # include the following zones when rendering named configs ZONES = { "nsec3-to-nsec.kasp", diff --git a/bin/tests/system/nsec3/tests_nsec3_reload.py b/bin/tests/system/nsec3/tests_nsec3_reload.py index 0e0daa884d1..33171932bd6 100644 --- a/bin/tests/system/nsec3/tests_nsec3_reload.py +++ b/bin/tests/system/nsec3/tests_nsec3_reload.py @@ -25,7 +25,6 @@ from nsec3.common import ( check_nsec3_case, ) - # include the following zones when rendering named configs ZONES = { "nsec3-fails-to-load.kasp", diff --git a/bin/tests/system/nsec3/tests_nsec3_restart.py b/bin/tests/system/nsec3/tests_nsec3_restart.py index 3505e8a5629..9771fd58128 100644 --- a/bin/tests/system/nsec3/tests_nsec3_restart.py +++ b/bin/tests/system/nsec3/tests_nsec3_restart.py @@ -28,7 +28,6 @@ from nsec3.common import ( check_nsec3param, ) - # include the following zones when rendering named configs ZONES = { "nsec3.kasp", diff --git a/bin/tests/system/optout/tests_optout.py b/bin/tests/system/optout/tests_optout.py index f004c1a89aa..1cc0132e3e1 100755 --- a/bin/tests/system/optout/tests_optout.py +++ b/bin/tests/system/optout/tests_optout.py @@ -28,7 +28,6 @@ import dns.rcode import dns.rdataclass import dns.rdatatype - pytestmark = [ pytest.mark.skipif( sys.version_info < (3, 7), reason="Python >= 3.7 required [GL #3001]" diff --git a/bin/tests/system/pipelined/ans5/ans.py b/bin/tests/system/pipelined/ans5/ans.py index b58ad84bef9..51f10ba3c70 100644 --- a/bin/tests/system/pipelined/ans5/ans.py +++ b/bin/tests/system/pipelined/ans5/ans.py @@ -199,7 +199,7 @@ def main(): while True: try: - (clientsock, _) = sock.accept() + clientsock, _ = sock.accept() log("Accepted connection from %s" % clientsock) thread = TCPDelayer(clientsock, serverip, port) thread.start() diff --git a/bin/tests/system/qmin/tests_sh_qmin.py b/bin/tests/system/qmin/tests_sh_qmin.py index 0858b5cbf76..1116f7ec6ce 100644 --- a/bin/tests/system/qmin/tests_sh_qmin.py +++ b/bin/tests/system/qmin/tests_sh_qmin.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "dig.out.*", diff --git a/bin/tests/system/query-source/tests_querysource_none.py b/bin/tests/system/query-source/tests_querysource_none.py index 9b078a40d25..4d27417aa7c 100644 --- a/bin/tests/system/query-source/tests_querysource_none.py +++ b/bin/tests/system/query-source/tests_querysource_none.py @@ -15,7 +15,6 @@ import pytest import isctest - pytestmark = pytest.mark.extra_artifacts( [ "ns*/named.pid", diff --git a/bin/tests/system/resolver/tests_sh_resolver.py b/bin/tests/system/resolver/tests_sh_resolver.py index 0a90735408e..10a36ce4e4f 100644 --- a/bin/tests/system/resolver/tests_sh_resolver.py +++ b/bin/tests/system/resolver/tests_sh_resolver.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ ".digrc", diff --git a/bin/tests/system/rndc/tests_cve-2023-3341.py b/bin/tests/system/rndc/tests_cve-2023-3341.py index 73a5117e9f0..90f2218a9bc 100644 --- a/bin/tests/system/rndc/tests_cve-2023-3341.py +++ b/bin/tests/system/rndc/tests_cve-2023-3341.py @@ -18,7 +18,6 @@ import pytest import isctest - pytestmark = pytest.mark.extra_artifacts( [ "ns2/nil.db", diff --git a/bin/tests/system/rollover-ksk-3crowd/tests_rollover_three_is_a_crowd.py b/bin/tests/system/rollover-ksk-3crowd/tests_rollover_three_is_a_crowd.py index 401324d9fb6..07c36d1bb05 100644 --- a/bin/tests/system/rollover-ksk-3crowd/tests_rollover_three_is_a_crowd.py +++ b/bin/tests/system/rollover-ksk-3crowd/tests_rollover_three_is_a_crowd.py @@ -30,7 +30,6 @@ from rollover.setup import ( configure_ksk_3crowd, ) - CDSS = ["CDS (SHA-256)"] POLICY = "ksk-doubleksk-autosign" OFFSET1 = -int(timedelta(days=60).total_seconds()) diff --git a/bin/tests/system/rpzextra/tests_rpzextra.py b/bin/tests/system/rpzextra/tests_rpzextra.py index 948d747f4a4..dc2353d039a 100644 --- a/bin/tests/system/rpzextra/tests_rpzextra.py +++ b/bin/tests/system/rpzextra/tests_rpzextra.py @@ -21,7 +21,6 @@ import dns.rrset import isctest - pytestmark = pytest.mark.extra_artifacts( [ "ns3/*-rpz-external.local.db", diff --git a/bin/tests/system/rpzrecurse/tests_sh_rpzrecurse.py b/bin/tests/system/rpzrecurse/tests_sh_rpzrecurse.py index 27f95755b8a..983c6c3c331 100644 --- a/bin/tests/system/rpzrecurse/tests_sh_rpzrecurse.py +++ b/bin/tests/system/rpzrecurse/tests_sh_rpzrecurse.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "dig.out.*", diff --git a/bin/tests/system/selftest/tests_zone_analyzer.py b/bin/tests/system/selftest/tests_zone_analyzer.py index 35e014059b8..90f76b8416e 100755 --- a/bin/tests/system/selftest/tests_zone_analyzer.py +++ b/bin/tests/system/selftest/tests_zone_analyzer.py @@ -14,7 +14,6 @@ isctest.name.ZoneAnalyzer self-test Generate insane test zone and check expected output of ZoneAnalyzer utility class """ - import collections import itertools from pathlib import Path @@ -27,7 +26,6 @@ import pytest import isctest import isctest.name - # set of properies present in the tested zone - read by tests_zone_analyzer.py CATEGORIES = frozenset( [ diff --git a/bin/tests/system/statistics/tests_sh_statistics.py b/bin/tests/system/statistics/tests_sh_statistics.py index d7d87abb0a6..48d40307400 100644 --- a/bin/tests/system/statistics/tests_sh_statistics.py +++ b/bin/tests/system/statistics/tests_sh_statistics.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "curl.out.*", diff --git a/bin/tests/system/statschannel/generic.py b/bin/tests/system/statschannel/generic.py index 611d3969257..fa64f5c483b 100644 --- a/bin/tests/system/statschannel/generic.py +++ b/bin/tests/system/statschannel/generic.py @@ -20,7 +20,6 @@ import dns.rcode import isctest - # ISO datetime format without msec fmt = "%Y-%m-%dT%H:%M:%SZ" @@ -87,7 +86,7 @@ def test_zone_timers_primary(fetch_zones, load_timers, **kwargs): zones = fetch_zones(statsip, statsport) for zone in zones: - (name, loaded, expires, refresh) = load_timers(zone, True) + name, loaded, expires, refresh = load_timers(zone, True) mtime = zone_mtime(zonedir, name) check_zone_timers(loaded, expires, refresh, mtime) @@ -103,7 +102,7 @@ def test_zone_timers_secondary(fetch_zones, load_timers, **kwargs): zones = fetch_zones(statsip, statsport) again = False for zone in zones: - (name, loaded, expires, refresh) = load_timers(zone, False) + name, loaded, expires, refresh = load_timers(zone, False) mtime = zone_mtime(zonedir, name) if (mtime != dayzero) or (tries == 0): # mtime was either retrieved successfully or no tries were diff --git a/bin/tests/system/statschannel/tests_json.py b/bin/tests/system/statschannel/tests_json.py index f7ab476e1c0..c495a94a83b 100755 --- a/bin/tests/system/statschannel/tests_json.py +++ b/bin/tests/system/statschannel/tests_json.py @@ -21,7 +21,6 @@ import isctest.mark pytest.register_assert_rewrite("generic") import generic - pytestmark = [ isctest.mark.with_json_c, pytest.mark.extra_artifacts( diff --git a/bin/tests/system/statschannel/tests_xml.py b/bin/tests/system/statschannel/tests_xml.py index 187f0fb97e7..97ca7c13650 100755 --- a/bin/tests/system/statschannel/tests_xml.py +++ b/bin/tests/system/statschannel/tests_xml.py @@ -22,7 +22,6 @@ import isctest.mark pytest.register_assert_rewrite("generic") import generic - pytestmark = [ isctest.mark.with_libxml2, pytest.mark.extra_artifacts( diff --git a/bin/tests/system/tcp/ans6/ans.py b/bin/tests/system/tcp/ans6/ans.py index b94697e2cd9..a9df8b7df7d 100644 --- a/bin/tests/system/tcp/ans6/ans.py +++ b/bin/tests/system/tcp/ans6/ans.py @@ -39,7 +39,6 @@ import socket import sys import time - # Timeout for establishing all connections requested by a single 'open' command. OPEN_TIMEOUT = 2 VERSION_QUERY = b"\x00\x1e\xaf\xb8\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x07version\x04bind\x00\x00\x10\x00\x03" @@ -136,7 +135,7 @@ def main(): ctlsock.listen(1) while True: - (clientsock, _) = ctlsock.accept() + clientsock, _ = ctlsock.accept() log("Accepted control connection from %s" % clientsock) cmdline = clientsock.recv(512).decode("ascii").strip() if cmdline: diff --git a/bin/tests/system/timeouts/tests_tcp_timeouts.py b/bin/tests/system/timeouts/tests_tcp_timeouts.py index e25bba5a042..ca982ef6c9f 100644 --- a/bin/tests/system/timeouts/tests_tcp_timeouts.py +++ b/bin/tests/system/timeouts/tests_tcp_timeouts.py @@ -170,7 +170,7 @@ def test_long_axfr(named_port): dns.query.send_tcp(sock, msg, timeout()) # Receive the initial DNS message with SOA - (response, _) = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) + response, _ = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) soa = response.get_rrset( dns.message.ANSWER, name, dns.rdataclass.IN, dns.rdatatype.SOA ) @@ -178,9 +178,7 @@ def test_long_axfr(named_port): # Pull DNS message from wire until the second SOA is received while True: - (response, _) = dns.query.receive_tcp( - sock, timeout(), one_rr_per_rrset=True - ) + response, _ = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) soa = response.get_rrset( dns.message.ANSWER, name, dns.rdataclass.IN, dns.rdatatype.SOA ) @@ -226,7 +224,7 @@ def test_max_transfer_idle_out(named_port): dns.query.send_tcp(sock, msg, timeout()) # Receive the initial DNS message with SOA - (response, _) = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) + response, _ = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) soa = response.get_rrset( dns.message.ANSWER, name, dns.rdataclass.IN, dns.rdatatype.SOA ) @@ -237,7 +235,7 @@ def test_max_transfer_idle_out(named_port): with pytest.raises(ConnectionResetError): # Process queued TCP messages while True: - (response, _) = dns.query.receive_tcp( + response, _ = dns.query.receive_tcp( sock, timeout(), one_rr_per_rrset=True ) soa = response.get_rrset( @@ -258,7 +256,7 @@ def test_max_transfer_time_out(named_port): dns.query.send_tcp(sock, msg, timeout()) # Receive the initial DNS message with SOA - (response, _) = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) + response, _ = dns.query.receive_tcp(sock, timeout(), one_rr_per_rrset=True) soa = response.get_rrset( dns.message.ANSWER, name, dns.rdataclass.IN, dns.rdatatype.SOA ) @@ -268,7 +266,7 @@ def test_max_transfer_time_out(named_port): with pytest.raises(EOFError): while True: time.sleep(1) - (response, _) = dns.query.receive_tcp( + response, _ = dns.query.receive_tcp( sock, timeout(), one_rr_per_rrset=True ) soa = response.get_rrset( diff --git a/bin/tests/system/tsig/tests_tsig_hypothesis.py b/bin/tests/system/tsig/tests_tsig_hypothesis.py index e26373b2207..5d31b58339c 100644 --- a/bin/tests/system/tsig/tests_tsig_hypothesis.py +++ b/bin/tests/system/tsig/tests_tsig_hypothesis.py @@ -34,7 +34,6 @@ from isctest.hypothesis.strategies import dns_names, uint from hypothesis import assume, example, given from hypothesis.strategies import binary, booleans, composite, just, sampled_from - pytestmark = pytest.mark.extra_artifacts( [ "ans*/ans.run", diff --git a/bin/tests/system/upforwd/tests_sh_upforwd.py b/bin/tests/system/upforwd/tests_sh_upforwd.py index 3dfa290a316..b4e04f907c1 100644 --- a/bin/tests/system/upforwd/tests_sh_upforwd.py +++ b/bin/tests/system/upforwd/tests_sh_upforwd.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "Ksig0.example2*", diff --git a/bin/tests/system/xfer/tests_sh_xfer.py b/bin/tests/system/xfer/tests_sh_xfer.py index 549fb241f5a..d94f90b9811 100644 --- a/bin/tests/system/xfer/tests_sh_xfer.py +++ b/bin/tests/system/xfer/tests_sh_xfer.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "axfr.out", diff --git a/bin/tests/system/xferquota/setup.py b/bin/tests/system/xferquota/setup.py index cbbb0529da8..ec457bf171f 100644 --- a/bin/tests/system/xferquota/setup.py +++ b/bin/tests/system/xferquota/setup.py @@ -20,8 +20,7 @@ zones = 300 for z in range(zones): zn = f"zone{z:06d}.example" with open(f"ns1/{zn}.db", "w", encoding="utf-8") as f: - f.write( - """$TTL 300 + f.write("""$TTL 300 @ IN SOA ns1 . 1 300 120 3600 86400 NS ns1 NS ns2 @@ -31,8 +30,7 @@ ns2 A 10.53.0.2 MX 20 mail2.isp.example. www A 10.0.0.1 xyzzy A 10.0.0.2 -""" - ) +""") with open("ns1/zones.conf", "w", encoding="utf-8") as priconf, open( "ns2/zones.conf", "w", encoding="utf-8" diff --git a/bin/tests/system/zero/tests_sh_zero.py b/bin/tests/system/zero/tests_sh_zero.py index a80a0d6ee70..3191f1c62a8 100644 --- a/bin/tests/system/zero/tests_sh_zero.py +++ b/bin/tests/system/zero/tests_sh_zero.py @@ -11,7 +11,6 @@ import pytest - pytestmark = pytest.mark.extra_artifacts( [ "dig.out*", diff --git a/contrib/gitchangelog/gitchangelog.py b/contrib/gitchangelog/gitchangelog.py index 33583185b9a..262a41c5521 100755 --- a/contrib/gitchangelog/gitchangelog.py +++ b/contrib/gitchangelog/gitchangelog.py @@ -483,7 +483,7 @@ class TextProc(object): return TextProc(lambda text: value.fun(self.fun(text))) import inspect - (_frame, filename, lineno, _function_name, lines, _index) = inspect.stack()[1] + _frame, filename, lineno, _function_name, lines, _index = inspect.stack()[1] raise SyntaxError( "Invalid syntax in config file", ( @@ -2084,10 +2084,7 @@ def safe_print(content): raise ## XXXvlab: should use $COLUMNS in bash and for windows: ## http://stackoverflow.com/questions/14978548 - stderr( - paragraph_wrap( - textwrap.dedent( - """\ + stderr(paragraph_wrap(textwrap.dedent("""\ UnicodeEncodeError: There was a problem outputing the resulting changelog to your console. @@ -2095,11 +2092,7 @@ def safe_print(content): This probably means that the changelog contains characters that can't be translated to characters in your current charset (%s). - """ - ) - % sys.stdout.encoding - ) - ) + """) % sys.stdout.encoding)) if WIN32 and PY_VERSION < 3.6 and sys.stdout.encoding != "utf-8": ## As of PY 3.6, encoding is now ``utf-8`` regardless of ## PYTHONIOENCODING diff --git a/doc/arm/_ext/iscconf.py b/doc/arm/_ext/iscconf.py index dc440e29284..43131941194 100644 --- a/doc/arm/_ext/iscconf.py +++ b/doc/arm/_ext/iscconf.py @@ -35,7 +35,6 @@ from sphinx.util.nodes import make_refnode import checkgrammar - logger = logging.getLogger(__name__) diff --git a/doc/arm/_ext/mergegrammar.py b/doc/arm/_ext/mergegrammar.py index 42fb502265b..e8aaac38931 100644 --- a/doc/arm/_ext/mergegrammar.py +++ b/doc/arm/_ext/mergegrammar.py @@ -18,7 +18,6 @@ from pathlib import Path import parsegrammar - misc_path = Path(__file__).resolve().parent.parent.parent / "misc" options_path = misc_path / "options" diff --git a/doc/misc/parsegrammar.py b/doc/misc/parsegrammar.py index b3fede04e50..eff382639bc 100644 --- a/doc/misc/parsegrammar.py +++ b/doc/misc/parsegrammar.py @@ -59,6 +59,7 @@ end node, key "_mapbody" denotes a nested map. } } """ + import fileinput import json import re