From: Štěpán Balážik Date: Wed, 4 Feb 2026 14:43:40 +0000 (+0100) Subject: Automatically sort imports in Python code X-Git-Tag: v9.21.19~15^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffd5b6ac262e8838dfc10790c6a67f545405a594;p=thirdparty%2Fbind9.git Automatically sort imports in Python code Generated with: ruff check --extend-select I --fix (with the changes to pyproject.toml applied). --- diff --git a/bin/tests/system/ans.py b/bin/tests/system/ans.py index 6ac5498d1db..3b822720a5f 100644 --- a/bin/tests/system/ans.py +++ b/bin/tests/system/ans.py @@ -32,9 +32,7 @@ useful in other system tests, please consider opening a merge request extending isctest/asyncserver.py. """ -from isctest.asyncserver import ( - AsyncDnsServer, -) +from isctest.asyncserver import AsyncDnsServer def main() -> None: diff --git a/bin/tests/system/bailiwick/ans1/ans.py b/bin/tests/system/bailiwick/ans1/ans.py index 117a014e932..7606236fdaa 100644 --- a/bin/tests/system/bailiwick/ans1/ans.py +++ b/bin/tests/system/bailiwick/ans1/ans.py @@ -16,11 +16,7 @@ from typing import AsyncGenerator import dns.rdatatype import dns.rrset -from isctest.asyncserver import ( - DnsResponseSend, - QueryContext, - ResponseAction, -) +from isctest.asyncserver import DnsResponseSend, QueryContext, ResponseAction from ..bailiwick_ans import ResponseSpoofer, spoofing_server diff --git a/bin/tests/system/bailiwick/ans2/ans.py b/bin/tests/system/bailiwick/ans2/ans.py index 8dfa0749c82..18781673570 100644 --- a/bin/tests/system/bailiwick/ans2/ans.py +++ b/bin/tests/system/bailiwick/ans2/ans.py @@ -16,11 +16,7 @@ from typing import AsyncGenerator import dns.rdatatype import dns.rrset -from isctest.asyncserver import ( - DnsResponseSend, - QueryContext, - ResponseAction, -) +from isctest.asyncserver import DnsResponseSend, QueryContext, ResponseAction from ..bailiwick_ans import ResponseSpoofer, spoofing_server diff --git a/bin/tests/system/bailiwick/tests_bailiwick.py b/bin/tests/system/bailiwick/tests_bailiwick.py index bd844bd71a3..105fc6de5a1 100644 --- a/bin/tests/system/bailiwick/tests_bailiwick.py +++ b/bin/tests/system/bailiwick/tests_bailiwick.py @@ -14,12 +14,12 @@ from typing import Dict import time import dns.message - import pytest -import isctest from isctest.instance import NamedInstance +import isctest + @pytest.fixture(autouse=True) def autouse_flush_resolver_cache(servers: Dict[str, NamedInstance]) -> None: diff --git a/bin/tests/system/checkds/tests_checkds.py b/bin/tests/system/checkds/tests_checkds.py index 26265ad6127..037517ca235 100755 --- a/bin/tests/system/checkds/tests_checkds.py +++ b/bin/tests/system/checkds/tests_checkds.py @@ -18,15 +18,15 @@ import os import sys import time -import isctest -import pytest - import dns.exception import dns.message import dns.name import dns.rcode import dns.rdataclass import dns.rdatatype +import pytest + +import isctest pytestmark = [ pytest.mark.skipif( diff --git a/bin/tests/system/cipher-suites/tests_cipher_suites.py b/bin/tests/system/cipher-suites/tests_cipher_suites.py index 4b2ba075187..94d0f255b79 100644 --- a/bin/tests/system/cipher-suites/tests_cipher_suites.py +++ b/bin/tests/system/cipher-suites/tests_cipher_suites.py @@ -11,9 +11,8 @@ from re import compile as Re -import pytest - import dns.message +import pytest import isctest import isctest.mark diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 3fba14c1c23..a9c3fc47dfa 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -9,24 +9,26 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import filecmp -import os from pathlib import Path from re import compile as Re + +import filecmp +import os import shutil import subprocess +import sys import tempfile import time -import sys import pytest pytest.register_assert_rewrite("isctest") # pylint: disable=wrong-import-position -import isctest from isctest.vars.build import SYSTEM_TEST_DIR_GIT_PATH +import isctest + # pylint: enable=wrong-import-position # Silence warnings caused by passing a pytest fixture to another fixture. diff --git a/bin/tests/system/cookie/cookie_ans.py b/bin/tests/system/cookie/cookie_ans.py index 72f0e0ab467..84d3f7011c7 100644 --- a/bin/tests/system/cookie/cookie_ans.py +++ b/bin/tests/system/cookie/cookie_ans.py @@ -20,12 +20,11 @@ import dns.tsigkeyring from isctest.asyncserver import ( AsyncDnsServer, - ResponseHandler, - DnsResponseSend, DnsProtocol, + DnsResponseSend, QueryContext, + ResponseHandler, ) - from isctest.name import prepend_label from isctest.vars.algorithms import ALG_VARS diff --git a/bin/tests/system/digdelv/ans4/ans.py b/bin/tests/system/digdelv/ans4/ans.py index 6f5346ff86c..d162070c76a 100644 --- a/bin/tests/system/digdelv/ans4/ans.py +++ b/bin/tests/system/digdelv/ans4/ans.py @@ -9,10 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from isctest.asyncserver import ( - AsyncDnsServer, - IgnoreAllQueries, -) +from isctest.asyncserver import AsyncDnsServer, IgnoreAllQueries def main() -> None: diff --git a/bin/tests/system/digdelv/ans5/ans.py b/bin/tests/system/digdelv/ans5/ans.py index a53045305d5..6039559449f 100644 --- a/bin/tests/system/digdelv/ans5/ans.py +++ b/bin/tests/system/digdelv/ans5/ans.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import logging from typing import AsyncGenerator, List, Optional +import logging + import dns.rcode import dns.rdatatype import dns.rrset diff --git a/bin/tests/system/digdelv/ans6/ans.py b/bin/tests/system/digdelv/ans6/ans.py index 77e71415907..e723d96c16e 100644 --- a/bin/tests/system/digdelv/ans6/ans.py +++ b/bin/tests/system/digdelv/ans6/ans.py @@ -17,8 +17,8 @@ import dns.rcode from isctest.asyncserver import ( AsyncDnsServer, DnsResponseSend, - ResponseHandler, QueryContext, + ResponseHandler, ) diff --git a/bin/tests/system/dispatch/tests_connreset.py b/bin/tests/system/dispatch/tests_connreset.py index 01a1bbc5c09..e263580cadd 100644 --- a/bin/tests/system/dispatch/tests_connreset.py +++ b/bin/tests/system/dispatch/tests_connreset.py @@ -11,10 +11,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +import dns.message import pytest -import isctest -import dns.message +import isctest pytestmark = pytest.mark.extra_artifacts( [ diff --git a/bin/tests/system/dnssec-malformed-dnskey/tests_malformed_dnskey.py b/bin/tests/system/dnssec-malformed-dnskey/tests_malformed_dnskey.py index 2e6c667d22c..efb5839ddc6 100644 --- a/bin/tests/system/dnssec-malformed-dnskey/tests_malformed_dnskey.py +++ b/bin/tests/system/dnssec-malformed-dnskey/tests_malformed_dnskey.py @@ -9,18 +9,18 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import base64 from re import compile as Re +import base64 import os -import pytest from cryptography.hazmat.primitives.asymmetric import ec +from dns.rdtypes.dnskeybase import Flag import dns import dns.dnssec import dns.zone -from dns.rdtypes.dnskeybase import Flag +import pytest import isctest diff --git a/bin/tests/system/dnssec/tests_badkey.py b/bin/tests/system/dnssec/tests_badkey.py index d7dffca0c2b..29f27f6757c 100644 --- a/bin/tests/system/dnssec/tests_badkey.py +++ b/bin/tests/system/dnssec/tests_badkey.py @@ -13,9 +13,10 @@ from dns import flags import pytest -import isctest from isctest.util import param +import isctest + 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 9de2252d099..35f6edba370 100644 --- a/bin/tests/system/dnssec/tests_delv.py +++ b/bin/tests/system/dnssec/tests_delv.py @@ -9,8 +9,9 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from re import compile as Re + +import os import subprocess import pytest diff --git a/bin/tests/system/dnssec/tests_policy.py b/bin/tests/system/dnssec/tests_policy.py index 06ec229b31f..fe04e06f389 100644 --- a/bin/tests/system/dnssec/tests_policy.py +++ b/bin/tests/system/dnssec/tests_policy.py @@ -10,6 +10,7 @@ # information regarding copyright ownership. from datetime import timedelta + import time from dns import rdatatype diff --git a/bin/tests/system/dnssec/tests_signing.py b/bin/tests/system/dnssec/tests_signing.py index 6eb9f9cba4d..949c0de8189 100644 --- a/bin/tests/system/dnssec/tests_signing.py +++ b/bin/tests/system/dnssec/tests_signing.py @@ -10,9 +10,10 @@ # information regarding copyright ownership. from collections import namedtuple +from re import compile as Re + import os import re -from re import compile as Re import struct import time @@ -21,6 +22,7 @@ from dns import dnssec, name, rdataclass, rdatatype, update import pytest from isctest.kasp import SettimeOptions + import isctest pytestmark = pytest.mark.extra_artifacts( diff --git a/bin/tests/system/dnssec/tests_tat.py b/bin/tests/system/dnssec/tests_tat.py index 2afff050aea..4e336bafea3 100644 --- a/bin/tests/system/dnssec/tests_tat.py +++ b/bin/tests/system/dnssec/tests_tat.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from re import compile as Re +import os + from dns import edns import pytest diff --git a/bin/tests/system/dnssec/tests_validation.py b/bin/tests/system/dnssec/tests_validation.py index 82a54f322c6..2c79f584f43 100644 --- a/bin/tests/system/dnssec/tests_validation.py +++ b/bin/tests/system/dnssec/tests_validation.py @@ -10,6 +10,7 @@ # information regarding copyright ownership. from re import compile as Re + import os import shutil import time @@ -19,9 +20,10 @@ from dns.edns import EDECode import pytest +from isctest.util import param + import isctest import isctest.mark -from isctest.util import param pytestmark = pytest.mark.extra_artifacts( [ diff --git a/bin/tests/system/dnssec/tests_validation_many_anchors.py b/bin/tests/system/dnssec/tests_validation_many_anchors.py index 85be391e865..5ff4afa527d 100644 --- a/bin/tests/system/dnssec/tests_validation_many_anchors.py +++ b/bin/tests/system/dnssec/tests_validation_many_anchors.py @@ -11,11 +11,13 @@ from dns.edns import EDECode + import pytest -import isctest from isctest.util import param +import isctest + def bootstrap(): return { diff --git a/bin/tests/system/dnssec/tests_validation_multiview.py b/bin/tests/system/dnssec/tests_validation_multiview.py index 26a8fb450e8..d3ea9e300bd 100644 --- a/bin/tests/system/dnssec/tests_validation_multiview.py +++ b/bin/tests/system/dnssec/tests_validation_multiview.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from re import compile as Re +import os + import isctest diff --git a/bin/tests/system/dnstap/tests_dnstap.py b/bin/tests/system/dnstap/tests_dnstap.py index 67061ab9a5c..9004c45e834 100644 --- a/bin/tests/system/dnstap/tests_dnstap.py +++ b/bin/tests/system/dnstap/tests_dnstap.py @@ -14,11 +14,11 @@ import os import re -import isctest -import isctest.mark +import dns.rrset import pytest -import dns.rrset +import isctest +import isctest.mark pytestmark = [ isctest.mark.with_dnstap, diff --git a/bin/tests/system/dnstap/ydump.py b/bin/tests/system/dnstap/ydump.py index ab7e3c9adad..77bca8be7f2 100644 --- a/bin/tests/system/dnstap/ydump.py +++ b/bin/tests/system/dnstap/ydump.py @@ -17,8 +17,8 @@ except (ModuleNotFoundError, ImportError): print("No python yaml module, skipping") sys.exit(1) -import subprocess import pprint +import subprocess DNSTAP_READ = sys.argv[1] DATAFILE = sys.argv[2] diff --git a/bin/tests/system/doth/conftest.py b/bin/tests/system/doth/conftest.py index b95baeaab5a..2c2104d2fd9 100644 --- a/bin/tests/system/doth/conftest.py +++ b/bin/tests/system/doth/conftest.py @@ -14,6 +14,7 @@ import shutil import pytest + import isctest diff --git a/bin/tests/system/doth/stress_http_quota.py b/bin/tests/system/doth/stress_http_quota.py index 930f944adf4..82730c25a5e 100755 --- a/bin/tests/system/doth/stress_http_quota.py +++ b/bin/tests/system/doth/stress_http_quota.py @@ -11,18 +11,16 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from functools import reduce +from resource import RLIMIT_NOFILE, getrlimit, setrlimit + import os -import sys +import random import socket import subprocess -import random +import sys import time -from functools import reduce -from resource import getrlimit -from resource import setrlimit -from resource import RLIMIT_NOFILE - MULTIDIG_INSTANCES = 10 CONNECT_TRIES = 5 diff --git a/bin/tests/system/doth/tests_gnutls.py b/bin/tests/system/doth/tests_gnutls.py index 70ddd261f6a..16ecdb5073a 100644 --- a/bin/tests/system/doth/tests_gnutls.py +++ b/bin/tests/system/doth/tests_gnutls.py @@ -16,13 +16,12 @@ import struct import subprocess import time -import pytest - import dns import dns.exception import dns.name import dns.rdataclass import dns.rdatatype +import pytest import isctest diff --git a/bin/tests/system/ecdsa/tests_ecdsa.py b/bin/tests/system/ecdsa/tests_ecdsa.py index 08b4ee0e685..95fcaf98565 100644 --- a/bin/tests/system/ecdsa/tests_ecdsa.py +++ b/bin/tests/system/ecdsa/tests_ecdsa.py @@ -10,9 +10,9 @@ # information regarding copyright ownership. import os -import pytest import dns.flags +import pytest import isctest diff --git a/bin/tests/system/filters/common.py b/bin/tests/system/filters/common.py index e5ff22e9772..6db8f197564 100644 --- a/bin/tests/system/filters/common.py +++ b/bin/tests/system/filters/common.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import dns from dns import rdataclass, rdatatype +import dns + import isctest ARTIFACTS = [ diff --git a/bin/tests/system/filters/tests_filter_a_v4.py b/bin/tests/system/filters/tests_filter_a_v4.py index cb690eb3528..e38a4f14226 100644 --- a/bin/tests/system/filters/tests_filter_a_v4.py +++ b/bin/tests/system/filters/tests_filter_a_v4.py @@ -11,8 +11,6 @@ import pytest -import isctest.mark - from filters.common import ( ARTIFACTS, check_filter, @@ -20,6 +18,8 @@ from filters.common import ( prime_cache, ) +import isctest.mark + 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 1d33f2fd057..69d56c0daee 100644 --- a/bin/tests/system/filters/tests_filter_a_v6.py +++ b/bin/tests/system/filters/tests_filter_a_v6.py @@ -11,8 +11,6 @@ import pytest -import isctest.mark - from filters.common import ( ARTIFACTS, check_filter, @@ -20,6 +18,8 @@ from filters.common import ( prime_cache, ) +import isctest.mark + 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 3c783a9cf32..adf46add049 100644 --- a/bin/tests/system/filters/tests_filter_aaaa_v4.py +++ b/bin/tests/system/filters/tests_filter_aaaa_v4.py @@ -11,9 +11,6 @@ import pytest -import isctest -import isctest.mark - from filters.common import ( ARTIFACTS, check_filter, @@ -21,6 +18,9 @@ from filters.common import ( prime_cache, ) +import isctest +import isctest.mark + 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 b973724e145..001a0dd5bf5 100644 --- a/bin/tests/system/filters/tests_filter_aaaa_v6.py +++ b/bin/tests/system/filters/tests_filter_aaaa_v6.py @@ -11,8 +11,6 @@ import pytest -import isctest.mark - from filters.common import ( ARTIFACTS, check_filter, @@ -20,6 +18,8 @@ from filters.common import ( prime_cache, ) +import isctest.mark + 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 de5eae132fd..46ab794c8ae 100644 --- a/bin/tests/system/filters/tests_filter_checkconf.py +++ b/bin/tests/system/filters/tests_filter_checkconf.py @@ -15,10 +15,10 @@ import subprocess import pytest -import isctest - from filters.common import ARTIFACTS +import isctest + 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 39c0bbc603f..dfa71b76c1d 100644 --- a/bin/tests/system/filters/tests_filter_dns64.py +++ b/bin/tests/system/filters/tests_filter_dns64.py @@ -11,10 +11,10 @@ import pytest -import isctest - from filters.common import ARTIFACTS +import isctest + pytestmark = pytest.mark.extra_artifacts(ARTIFACTS) diff --git a/bin/tests/system/hooks/tests_hooks.py b/bin/tests/system/hooks/tests_hooks.py index 87ad1de89d6..75305e9b353 100644 --- a/bin/tests/system/hooks/tests_hooks.py +++ b/bin/tests/system/hooks/tests_hooks.py @@ -15,6 +15,7 @@ import subprocess import dns import pytest + import isctest pytestmark = pytest.mark.extra_artifacts(["conf/*.conf"]) diff --git a/bin/tests/system/isctest/__init__.py b/bin/tests/system/isctest/__init__.py index 4b5f299376a..c5e4fc0ed54 100644 --- a/bin/tests/system/isctest/__init__.py +++ b/bin/tests/system/isctest/__init__.py @@ -9,15 +9,17 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from . import check -from . import instance -from . import hypothesis -from . import query -from . import kasp -from . import run -from . import template -from . import log -from . import vars # pylint: disable=redefined-builtin +from . import ( # pylint: disable=redefined-builtin + check, + hypothesis, + instance, + kasp, + log, + query, + run, + template, + vars, +) # isctest.mark module is intentionally NOT imported, because it relies on # environment variables which might not be set at the time of import of the diff --git a/bin/tests/system/isctest/asyncserver.py b/bin/tests/system/isctest/asyncserver.py index 8e4ea245e5a..72979399a61 100644 --- a/bin/tests/system/isctest/asyncserver.py +++ b/bin/tests/system/isctest/asyncserver.py @@ -20,8 +20,8 @@ from typing import ( Dict, List, Optional, - Set, Sequence, + Set, Tuple, Union, cast, diff --git a/bin/tests/system/isctest/check.py b/bin/tests/system/isctest/check.py index f7a1f12a849..c0a550b42d4 100644 --- a/bin/tests/system/isctest/check.py +++ b/bin/tests/system/isctest/check.py @@ -9,13 +9,15 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from typing import List, Optional, cast + import difflib -import shutil import os -from typing import cast, List, Optional +import shutil -import dns.edns from dns.edns import EDECode, EDEOption + +import dns.edns import dns.flags import dns.message import dns.rcode diff --git a/bin/tests/system/isctest/hypothesis/__init__.py b/bin/tests/system/isctest/hypothesis/__init__.py index 6c2cc00210f..e4cda096293 100644 --- a/bin/tests/system/isctest/hypothesis/__init__.py +++ b/bin/tests/system/isctest/hypothesis/__init__.py @@ -12,5 +12,4 @@ # This ensures we're using a suitable hypothesis version. A newer version is # required for FIPS-enabled platforms. -from . import settings -from . import strategies +from . import settings, strategies diff --git a/bin/tests/system/isctest/hypothesis/strategies.py b/bin/tests/system/isctest/hypothesis/strategies.py index e8badc6802b..1a008518890 100644 --- a/bin/tests/system/isctest/hypothesis/strategies.py +++ b/bin/tests/system/isctest/hypothesis/strategies.py @@ -11,10 +11,11 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import collections.abc from typing import List, Union from warnings import warn +import collections.abc + from hypothesis.strategies import ( binary, builds, @@ -26,8 +27,8 @@ from hypothesis.strategies import ( sampled_from, ) -import dns.name import dns.message +import dns.name import dns.rdataclass import dns.rdatatype diff --git a/bin/tests/system/isctest/instance.py b/bin/tests/system/isctest/instance.py index 129a2a907a7..58e027fe8ef 100644 --- a/bin/tests/system/isctest/instance.py +++ b/bin/tests/system/isctest/instance.py @@ -11,18 +11,18 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from pathlib import Path from typing import List, NamedTuple, Optional import os -from pathlib import Path import re -import dns.update import dns.rcode +import dns.update -from .log import debug, WatchLogFromStart, WatchLogFromHere -from .run import CmdResult, EnvCmd, perl +from .log import WatchLogFromHere, WatchLogFromStart, debug from .query import udp +from .run import CmdResult, EnvCmd, perl from .text import TextFile diff --git a/bin/tests/system/isctest/kasp.py b/bin/tests/system/isctest/kasp.py index 9364f3c752d..e7227f7c6a9 100644 --- a/bin/tests/system/isctest/kasp.py +++ b/bin/tests/system/isctest/kasp.py @@ -12,13 +12,14 @@ from dataclasses import dataclass from datetime import datetime, timedelta, timezone from functools import total_ordering +from pathlib import Path +from re import compile as Re +from typing import Dict, List, Optional, Tuple, Union + import glob import os -from pathlib import Path import re -from re import compile as Re import time -from typing import Dict, List, Optional, Tuple, Union import dns import dns.dnssec @@ -26,13 +27,14 @@ import dns.rdatatype import dns.rrset import dns.tsig +from isctest.instance import NamedInstance +from isctest.run import EnvCmd +from isctest.template import TrustAnchor +from isctest.vars.algorithms import ALL_ALGORITHMS_BY_NUM, Algorithm + import isctest.log import isctest.query import isctest.util -from isctest.instance import NamedInstance -from isctest.template import TrustAnchor -from isctest.run import EnvCmd -from isctest.vars.algorithms import Algorithm, ALL_ALGORITHMS_BY_NUM DEFAULT_TTL = 300 diff --git a/bin/tests/system/isctest/log/__init__.py b/bin/tests/system/isctest/log/__init__.py index 228f69e5bfa..45ec242e399 100644 --- a/bin/tests/system/isctest/log/__init__.py +++ b/bin/tests/system/isctest/log/__init__.py @@ -11,16 +11,15 @@ from .basic import ( avoid_duplicated_logs, + critical, + debug, deinit_module_logger, deinit_test_logger, + error, + info, init_conftest_logger, init_module_logger, init_test_logger, - debug, - info, warning, - error, - critical, ) - -from .watchlog import WatchLogFromStart, WatchLogFromHere +from .watchlog import WatchLogFromHere, WatchLogFromStart diff --git a/bin/tests/system/isctest/log/basic.py b/bin/tests/system/isctest/log/basic.py index 812e83e2544..89201f61c71 100644 --- a/bin/tests/system/isctest/log/basic.py +++ b/bin/tests/system/isctest/log/basic.py @@ -9,11 +9,12 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import logging from pathlib import Path -import textwrap from typing import Dict, Optional +import logging +import textwrap + 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 d7154995b7d..5c2bab0f202 100644 --- a/bin/tests/system/isctest/log/watchlog.py +++ b/bin/tests/system/isctest/log/watchlog.py @@ -15,7 +15,7 @@ import abc import os import time -from isctest.text import compile_pattern, FlexPattern, LineReader +from isctest.text import FlexPattern, LineReader, compile_pattern T = TypeVar("T") OneOrMore = Union[T, List[T]] diff --git a/bin/tests/system/isctest/mark.py b/bin/tests/system/isctest/mark.py index 3eec519c756..1335da8417d 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -13,8 +13,8 @@ import os import platform -import socket import shutil +import socket import pytest diff --git a/bin/tests/system/isctest/name.py b/bin/tests/system/isctest/name.py index cc836f85db5..cc80f44d795 100644 --- a/bin/tests/system/isctest/name.py +++ b/bin/tests/system/isctest/name.py @@ -9,13 +9,13 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import Iterable, FrozenSet +from typing import FrozenSet, Iterable + +from dns.name import Name import dns.name -import dns.zone import dns.rdatatype - -from dns.name import Name +import dns.zone def prepend_label(label: str, name: Name) -> Name: diff --git a/bin/tests/system/isctest/query.py b/bin/tests/system/isctest/query.py index daa8ade0142..f8a62150c40 100644 --- a/bin/tests/system/isctest/query.py +++ b/bin/tests/system/isctest/query.py @@ -9,12 +9,13 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from typing import Any, Callable, Optional + import os import time -from typing import Any, Callable, Optional -import dns.query import dns.message +import dns.query import isctest.log diff --git a/bin/tests/system/isctest/run.py b/bin/tests/system/isctest/run.py index 65fd5ec8df5..7c7559726d2 100644 --- a/bin/tests/system/isctest/run.py +++ b/bin/tests/system/isctest/run.py @@ -9,11 +9,12 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from pathlib import Path +from typing import List, Optional + +import os import subprocess import time -from typing import List, Optional import isctest.log import isctest.text diff --git a/bin/tests/system/isctest/text.py b/bin/tests/system/isctest/text.py index 33798c37032..549f06ff7f3 100644 --- a/bin/tests/system/isctest/text.py +++ b/bin/tests/system/isctest/text.py @@ -11,11 +11,12 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import abc -import re from re import compile as Re from typing import Iterator, List, Match, Optional, Pattern, TextIO, Union +import abc +import re + FlexPattern = Union[str, Pattern] diff --git a/bin/tests/system/isctest/vars/__init__.py b/bin/tests/system/isctest/vars/__init__.py index 3ebaf3df5e8..3fea2f345c7 100644 --- a/bin/tests/system/isctest/vars/__init__.py +++ b/bin/tests/system/isctest/vars/__init__.py @@ -11,11 +11,11 @@ import os -from .all import ALL +from .. import log from .algorithms import init_crypto_supported, set_algorithm_set +from .all import ALL from .features import init_features from .openssl import parse_openssl_config -from .. import log def init_vars(): diff --git a/bin/tests/system/isctest/vars/algorithms.py b/bin/tests/system/isctest/vars/algorithms.py index 58b5a9a652c..5be34ff7d78 100644 --- a/bin/tests/system/isctest/vars/algorithms.py +++ b/bin/tests/system/isctest/vars/algorithms.py @@ -9,16 +9,17 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from typing import Dict, List, NamedTuple, Optional, Union + import os import platform import random import subprocess import tempfile import time -from typing import Dict, List, NamedTuple, Optional, Union -from .basic import BASIC_VARS from .. import log +from .basic import BASIC_VARS # Algorithms are selected randomly at runtime from a list of supported # algorithms. The randomization is deterministic and remains stable for a diff --git a/bin/tests/system/isctest/vars/all.py b/bin/tests/system/isctest/vars/all.py index 9ef81b96aa0..ba3f2a33814 100644 --- a/bin/tests/system/isctest/vars/all.py +++ b/bin/tests/system/isctest/vars/all.py @@ -11,12 +11,12 @@ from collections import ChainMap -# pylint: disable=import-error -from .build import BUILD_VARS # type: ignore - # pylint: enable=import-error from .algorithms import ALG_VARS, CRYPTO_SUPPORTED_VARS from .basic import BASIC_VARS + +# pylint: disable=import-error +from .build import BUILD_VARS # type: ignore from .dirs import DIR_VARS from .features import FEATURE_VARS from .openssl import OPENSSL_VARS diff --git a/bin/tests/system/isctest/vars/openssl.py b/bin/tests/system/isctest/vars/openssl.py index 52b42ccfd9c..c6ea821fa25 100644 --- a/bin/tests/system/isctest/vars/openssl.py +++ b/bin/tests/system/isctest/vars/openssl.py @@ -9,10 +9,11 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from re import compile as Re from typing import Optional +import os + from .. import log OPENSSL_VARS = { diff --git a/bin/tests/system/kasp/tests_kasp.py b/bin/tests/system/kasp/tests_kasp.py index 6d9a7e7a462..87ecbcab240 100644 --- a/bin/tests/system/kasp/tests_kasp.py +++ b/bin/tests/system/kasp/tests_kasp.py @@ -9,27 +9,24 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from datetime import timedelta + import os import shutil import subprocess import time -from datetime import timedelta - import dns import dns.update import pytest -import isctest -import isctest.mark -from isctest.kasp import ( - KeyProperties, - KeyTimingMetadata, - SettimeOptions, -) +from isctest.kasp import KeyProperties, KeyTimingMetadata, SettimeOptions from isctest.util import param from isctest.vars.algorithms import ECDSAP256SHA256, ECDSAP384SHA384 +import isctest +import isctest.mark + pytestmark = pytest.mark.extra_artifacts( [ "K*.private", diff --git a/bin/tests/system/keepalive/tests_keepalive.py b/bin/tests/system/keepalive/tests_keepalive.py index 40f9c4a21b9..cfd2bcbe2c8 100644 --- a/bin/tests/system/keepalive/tests_keepalive.py +++ b/bin/tests/system/keepalive/tests_keepalive.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import isctest import pytest +import isctest + 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 d5c18e4f356..b088d431b78 100644 --- a/bin/tests/system/keyfromlabel/tests_keyfromlabel.py +++ b/bin/tests/system/keyfromlabel/tests_keyfromlabel.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from re import compile as Re + import hashlib import os -from re import compile as Re import shutil import pytest diff --git a/bin/tests/system/ksr/tests_ksr.py b/bin/tests/system/ksr/tests_ksr.py index 78c8f841b90..2164894042d 100644 --- a/bin/tests/system/ksr/tests_ksr.py +++ b/bin/tests/system/ksr/tests_ksr.py @@ -10,6 +10,7 @@ # information regarding copyright ownership. from datetime import timedelta + import os import re import shutil @@ -17,9 +18,10 @@ import time import pytest -import isctest from isctest.kasp import KeyTimingMetadata +import isctest + pytestmark = pytest.mark.extra_artifacts( [ "K*", diff --git a/bin/tests/system/limits/tests_limits.py b/bin/tests/system/limits/tests_limits.py index 6949838ec74..512c02ecca1 100644 --- a/bin/tests/system/limits/tests_limits.py +++ b/bin/tests/system/limits/tests_limits.py @@ -11,10 +11,10 @@ import itertools -import isctest +import dns.rrset import pytest -import dns.rrset +import isctest @pytest.mark.parametrize( diff --git a/bin/tests/system/masterfile/tests_masterfile.py b/bin/tests/system/masterfile/tests_masterfile.py index ae85d7bde43..598445555db 100644 --- a/bin/tests/system/masterfile/tests_masterfile.py +++ b/bin/tests/system/masterfile/tests_masterfile.py @@ -13,9 +13,9 @@ import os import dns.message import dns.zone +import pytest import isctest -import pytest pytestmark = pytest.mark.extra_artifacts( ["ns2/copied.db", "ns2/present.db", "ns2/alternate.db"] diff --git a/bin/tests/system/migrate2kasp/tests_migrate2kasp.py b/bin/tests/system/migrate2kasp/tests_migrate2kasp.py index cb5f6e20516..76c670fafbb 100644 --- a/bin/tests/system/migrate2kasp/tests_migrate2kasp.py +++ b/bin/tests/system/migrate2kasp/tests_migrate2kasp.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from datetime import timedelta +import os + import pytest import isctest diff --git a/bin/tests/system/multisigner/tests_multisigner.py b/bin/tests/system/multisigner/tests_multisigner.py index 6d3eeeac5a5..894c0dd5b51 100644 --- a/bin/tests/system/multisigner/tests_multisigner.py +++ b/bin/tests/system/multisigner/tests_multisigner.py @@ -10,13 +10,13 @@ # information regarding copyright ownership. from datetime import timedelta -import os from re import compile as Re -import pytest +import os import dns import dns.update +import pytest import isctest diff --git a/bin/tests/system/nsec3-answer/tests_nsec3.py b/bin/tests/system/nsec3-answer/tests_nsec3.py index ebd0ea66233..c926d053f19 100755 --- a/bin/tests/system/nsec3-answer/tests_nsec3.py +++ b/bin/tests/system/nsec3-answer/tests_nsec3.py @@ -16,11 +16,12 @@ # pylint: disable=unreachable from dataclasses import dataclass -import os from pathlib import Path from typing import Container, Iterable, Optional, Set, Tuple -import pytest +import os + +from hypothesis import assume, given import dns.dnssec import dns.message @@ -29,16 +30,16 @@ import dns.query import dns.rcode import dns.rdataclass import dns.rdatatype -import dns.rdtypes.ANY.RRSIG import dns.rdtypes.ANY.NSEC3 +import dns.rdtypes.ANY.RRSIG import dns.rrset +import pytest from isctest.hypothesis.strategies import dns_names, sampled_from + import isctest import isctest.name -from hypothesis import assume, given - SUFFIX = dns.name.from_text(".") AUTH = "10.53.0.1" RESOLVER = "10.53.0.2" diff --git a/bin/tests/system/nsec3/common.py b/bin/tests/system/nsec3/common.py index 2a12eb4933c..85afe2b23a3 100644 --- a/bin/tests/system/nsec3/common.py +++ b/bin/tests/system/nsec3/common.py @@ -9,10 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os - from datetime import timedelta +import os + import dns import pytest diff --git a/bin/tests/system/nsec3/tests_nsec3_change.py b/bin/tests/system/nsec3/tests_nsec3_change.py index d5ec16f5b40..beaea9554d6 100644 --- a/bin/tests/system/nsec3/tests_nsec3_change.py +++ b/bin/tests/system/nsec3/tests_nsec3_change.py @@ -19,16 +19,11 @@ import dns import dns.update import pytest +from isctest.vars.algorithms import RSASHA1 +from nsec3.common import ALGORITHM, SIZE, check_nsec3_case, default_config, pytestmark + import isctest import isctest.mark -from isctest.vars.algorithms import RSASHA1 -from nsec3.common import ( - ALGORITHM, - SIZE, - default_config, - pytestmark, - check_nsec3_case, -) # include the following zones when rendering named configs ZONES = { diff --git a/bin/tests/system/nsec3/tests_nsec3_initial.py b/bin/tests/system/nsec3/tests_nsec3_initial.py index 038cd144284..19ba62600d8 100644 --- a/bin/tests/system/nsec3/tests_nsec3_initial.py +++ b/bin/tests/system/nsec3/tests_nsec3_initial.py @@ -17,16 +17,11 @@ import dns import dns.update import pytest +from isctest.vars.algorithms import RSASHA1 +from nsec3.common import ALGORITHM, SIZE, check_nsec3_case, default_config, pytestmark + import isctest import isctest.mark -from isctest.vars.algorithms import RSASHA1 -from nsec3.common import ( - ALGORITHM, - SIZE, - default_config, - pytestmark, - check_nsec3_case, -) # include the following zones when rendering named configs ZONES = { diff --git a/bin/tests/system/nsec3/tests_nsec3_reconfig.py b/bin/tests/system/nsec3/tests_nsec3_reconfig.py index cb75f1caa49..a725039ed46 100644 --- a/bin/tests/system/nsec3/tests_nsec3_reconfig.py +++ b/bin/tests/system/nsec3/tests_nsec3_reconfig.py @@ -19,16 +19,11 @@ import dns import dns.update import pytest +from isctest.vars.algorithms import RSASHA1 +from nsec3.common import ALGORITHM, SIZE, check_nsec3_case, default_config, pytestmark + import isctest import isctest.mark -from isctest.vars.algorithms import RSASHA1 -from nsec3.common import ( - ALGORITHM, - SIZE, - default_config, - pytestmark, - check_nsec3_case, -) # include the following zones when rendering named configs ZONES = { diff --git a/bin/tests/system/nsec3/tests_nsec3_reload.py b/bin/tests/system/nsec3/tests_nsec3_reload.py index 33171932bd6..d23d7df64b6 100644 --- a/bin/tests/system/nsec3/tests_nsec3_reload.py +++ b/bin/tests/system/nsec3/tests_nsec3_reload.py @@ -18,12 +18,9 @@ import time import dns import pytest +from nsec3.common import ALGORITHM, SIZE, check_nsec3_case + import isctest -from nsec3.common import ( - ALGORITHM, - SIZE, - check_nsec3_case, -) # include the following zones when rendering named configs ZONES = { diff --git a/bin/tests/system/nsec3/tests_nsec3_restart.py b/bin/tests/system/nsec3/tests_nsec3_restart.py index 9771fd58128..63c65381723 100644 --- a/bin/tests/system/nsec3/tests_nsec3_restart.py +++ b/bin/tests/system/nsec3/tests_nsec3_restart.py @@ -17,17 +17,18 @@ import dns import dns.update import pytest -import isctest -import isctest.mark from nsec3.common import ( ALGORITHM, SIZE, - default_config, - pytestmark, check_nsec3_case, check_nsec3param, + default_config, + pytestmark, ) +import isctest +import isctest.mark + # include the following zones when rendering named configs ZONES = { "nsec3.kasp", diff --git a/bin/tests/system/nsec3/tests_nsec3_retransfer.py b/bin/tests/system/nsec3/tests_nsec3_retransfer.py index f9a3ca2e509..586047c1154 100644 --- a/bin/tests/system/nsec3/tests_nsec3_retransfer.py +++ b/bin/tests/system/nsec3/tests_nsec3_retransfer.py @@ -12,6 +12,7 @@ # pylint: disable=redefined-outer-name,unused-import from datetime import timedelta + import os import shutil @@ -19,14 +20,11 @@ import dns import dns.update import pytest +from isctest.vars.algorithms import RSASHA256 +from nsec3.common import check_auth_nsec3, check_nsec3param, pytestmark + import isctest import isctest.mark -from isctest.vars.algorithms import RSASHA256 -from nsec3.common import ( - pytestmark, - check_auth_nsec3, - check_nsec3param, -) DNSKEY_TTL = int(timedelta(hours=1).total_seconds()) ZSK_LIFETIME = int(timedelta(days=90).total_seconds()) diff --git a/bin/tests/system/nsupdate/ans4/ans.py b/bin/tests/system/nsupdate/ans4/ans.py index ab066c4beeb..da1f43886b2 100644 --- a/bin/tests/system/nsupdate/ans4/ans.py +++ b/bin/tests/system/nsupdate/ans4/ans.py @@ -9,11 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from isctest.asyncserver import ( - AsyncDnsServer, - IgnoreAllConnections, - IgnoreAllQueries, -) +from isctest.asyncserver import AsyncDnsServer, IgnoreAllConnections, IgnoreAllQueries def main() -> None: diff --git a/bin/tests/system/nta/tests_nta.py b/bin/tests/system/nta/tests_nta.py index d2b056cb76f..ece8db67295 100644 --- a/bin/tests/system/nta/tests_nta.py +++ b/bin/tests/system/nta/tests_nta.py @@ -9,8 +9,9 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import os from re import compile as Re + +import os import time import isctest diff --git a/bin/tests/system/nzd2nzf/tests_nzd2nzf.py b/bin/tests/system/nzd2nzf/tests_nzd2nzf.py index 790e937556a..54e5a2c95b2 100644 --- a/bin/tests/system/nzd2nzf/tests_nzd2nzf.py +++ b/bin/tests/system/nzd2nzf/tests_nzd2nzf.py @@ -11,6 +11,7 @@ import os + import pytest import isctest diff --git a/bin/tests/system/optout/tests_optout.py b/bin/tests/system/optout/tests_optout.py index 1cc0132e3e1..3944649f2d8 100755 --- a/bin/tests/system/optout/tests_optout.py +++ b/bin/tests/system/optout/tests_optout.py @@ -16,9 +16,6 @@ import os import re import sys -import isctest -import pytest - import dns import dns.exception import dns.message @@ -27,6 +24,9 @@ import dns.query import dns.rcode import dns.rdataclass import dns.rdatatype +import pytest + +import isctest pytestmark = [ pytest.mark.skipif( diff --git a/bin/tests/system/re_compile_checker.py b/bin/tests/system/re_compile_checker.py index 5dd214f18e5..447f88e17ec 100644 --- a/bin/tests/system/re_compile_checker.py +++ b/bin/tests/system/re_compile_checker.py @@ -14,7 +14,6 @@ import re from astroid import nodes - from pylint.checkers import BaseRawFileChecker from pylint.lint import PyLinter diff --git a/bin/tests/system/resolver/ans2/ans.py b/bin/tests/system/resolver/ans2/ans.py index 9f1be141b4b..130d778df96 100644 --- a/bin/tests/system/resolver/ans2/ans.py +++ b/bin/tests/system/resolver/ans2/ans.py @@ -16,8 +16,8 @@ from typing import AsyncGenerator, Tuple, Union import dns.edns import dns.name import dns.rcode -import dns.rrset import dns.rdatatype +import dns.rrset from isctest.asyncserver import ( AsyncDnsServer, @@ -27,8 +27,8 @@ from isctest.asyncserver import ( QnameHandler, QnameQtypeHandler, QueryContext, - StaticResponseHandler, ResponseHandler, + StaticResponseHandler, ) from ..resolver_ans import ( diff --git a/bin/tests/system/resolver/ans3/ans.py b/bin/tests/system/resolver/ans3/ans.py index f3143f512dc..36172f76851 100644 --- a/bin/tests/system/resolver/ans3/ans.py +++ b/bin/tests/system/resolver/ans3/ans.py @@ -25,8 +25,8 @@ from isctest.asyncserver import ( QnameHandler, QnameQtypeHandler, QueryContext, - StaticResponseHandler, ResponseHandler, + StaticResponseHandler, ) from ..resolver_ans import ( diff --git a/bin/tests/system/resolver/ans8/ans.py b/bin/tests/system/resolver/ans8/ans.py index 7d677265fac..6ef65f21571 100644 --- a/bin/tests/system/resolver/ans8/ans.py +++ b/bin/tests/system/resolver/ans8/ans.py @@ -11,10 +11,10 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -import abc - from typing import AsyncGenerator +import abc + import dns.flags import dns.message import dns.rcode @@ -22,8 +22,8 @@ import dns.rdatatype from isctest.asyncserver import ( AsyncDnsServer, - DnsResponseSend, DnsProtocol, + DnsResponseSend, DomainHandler, QnameHandler, QnameQtypeHandler, diff --git a/bin/tests/system/rfc5011/tests_rfc5011.py b/bin/tests/system/rfc5011/tests_rfc5011.py index 283e9c7ba83..c7834b66539 100644 --- a/bin/tests/system/rfc5011/tests_rfc5011.py +++ b/bin/tests/system/rfc5011/tests_rfc5011.py @@ -10,6 +10,7 @@ # information regarding copyright ownership. import pytest + from isctest.mark import live_internet_test pytestmark = pytest.mark.extra_artifacts( diff --git a/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_initial.py b/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_initial.py index 069583179ac..c04ffe599c8 100644 --- a/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_initial.py +++ b/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_initial.py @@ -13,20 +13,11 @@ import pytest -import isctest from isctest.util import param -from rollover.common import ( - pytestmark, - CDSS, - DURATION, - TIMEDELTA, - ALGOROLL_CONFIG, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_algo_csk, -) +from rollover.common import ALGOROLL_CONFIG, CDSS, DURATION, TIMEDELTA, pytestmark +from rollover.setup import configure_algo_csk, configure_root, configure_tld + +import isctest POLICY = "csk-algoroll" diff --git a/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_reconfig.py b/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_reconfig.py index 5ef6131a850..c2d47824ade 100644 --- a/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_reconfig.py +++ b/bin/tests/system/rollover-algo-csk/tests_rollover_algo_csk_reconfig.py @@ -13,14 +13,9 @@ import pytest -import isctest from isctest.kasp import KeyTimingMetadata from isctest.util import param from rollover.common import ( - pytestmark, - alg, - size, - CDSS, ALGOROLL_CONFIG, ALGOROLL_IPUB, ALGOROLL_IPUBC, @@ -29,14 +24,16 @@ from rollover.common import ( ALGOROLL_KEYTTLPROP, ALGOROLL_OFFSETS, ALGOROLL_OFFVAL, + CDSS, DURATION, TIMEDELTA, + alg, + pytestmark, + size, ) -from rollover.setup import ( - configure_root, - configure_tld, - configure_algo_csk, -) +from rollover.setup import configure_algo_csk, configure_root, configure_tld + +import isctest CONFIG = ALGOROLL_CONFIG POLICY = "csk-algoroll" diff --git a/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_initial.py b/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_initial.py index 826d8a1254d..51168a87a58 100644 --- a/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_initial.py +++ b/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_initial.py @@ -13,20 +13,11 @@ import pytest -import isctest from isctest.util import param -from rollover.common import ( - pytestmark, - CDSS, - DURATION, - TIMEDELTA, - ALGOROLL_CONFIG, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_algo_ksk_zsk, -) +from rollover.common import ALGOROLL_CONFIG, CDSS, DURATION, TIMEDELTA, pytestmark +from rollover.setup import configure_algo_ksk_zsk, configure_root, configure_tld + +import isctest def bootstrap(): diff --git a/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_reconfig.py b/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_reconfig.py index a1b26882128..7d8c169e970 100644 --- a/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_reconfig.py +++ b/bin/tests/system/rollover-algo-ksk-zsk/tests_rollover_algo_ksk_zsk_reconfig.py @@ -13,14 +13,9 @@ import pytest -import isctest from isctest.kasp import KeyTimingMetadata from isctest.util import param from rollover.common import ( - pytestmark, - alg, - size, - CDSS, ALGOROLL_CONFIG, ALGOROLL_IPUB, ALGOROLL_IPUBC, @@ -29,14 +24,16 @@ from rollover.common import ( ALGOROLL_KEYTTLPROP, ALGOROLL_OFFSETS, ALGOROLL_OFFVAL, + CDSS, DURATION, TIMEDELTA, + alg, + pytestmark, + size, ) -from rollover.setup import ( - configure_root, - configure_tld, - configure_algo_ksk_zsk, -) +from rollover.setup import configure_algo_ksk_zsk, configure_root, configure_tld + +import isctest CONFIG = ALGOROLL_CONFIG POLICY = "ecdsa256" diff --git a/bin/tests/system/rollover-csk-roll1/tests_rollover_csk_roll1.py b/bin/tests/system/rollover-csk-roll1/tests_rollover_csk_roll1.py index 03acab2ce7a..eebeea47234 100644 --- a/bin/tests/system/rollover-csk-roll1/tests_rollover_csk_roll1.py +++ b/bin/tests/system/rollover-csk-roll1/tests_rollover_csk_roll1.py @@ -15,20 +15,12 @@ from datetime import timedelta import pytest -import isctest from isctest.kasp import Ipub, Iret from isctest.util import param -from rollover.common import ( - pytestmark, - alg, - size, - TIMEDELTA, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_cskroll1, -) +from rollover.common import TIMEDELTA, alg, pytestmark, size +from rollover.setup import configure_cskroll1, configure_root, configure_tld + +import isctest CDSS = ["CDNSKEY", "CDS (SHA-384)"] CONFIG = { diff --git a/bin/tests/system/rollover-csk-roll2/tests_rollover_csk_roll2.py b/bin/tests/system/rollover-csk-roll2/tests_rollover_csk_roll2.py index d08aaa2d404..9993b83ecdc 100644 --- a/bin/tests/system/rollover-csk-roll2/tests_rollover_csk_roll2.py +++ b/bin/tests/system/rollover-csk-roll2/tests_rollover_csk_roll2.py @@ -15,20 +15,12 @@ from datetime import timedelta import pytest -import isctest from isctest.kasp import Ipub, Iret from isctest.util import param -from rollover.common import ( - pytestmark, - alg, - size, - TIMEDELTA, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_cskroll2, -) +from rollover.common import TIMEDELTA, alg, pytestmark, size +from rollover.setup import configure_cskroll2, configure_root, configure_tld + +import isctest CDSS = ["CDNSKEY", "CDS (SHA-256)", "CDS (SHA-384)"] CONFIG = { diff --git a/bin/tests/system/rollover-dynamic2inline/tests_rollover_dynamic2inline.py b/bin/tests/system/rollover-dynamic2inline/tests_rollover_dynamic2inline.py index 7ec85911953..946a7c14201 100644 --- a/bin/tests/system/rollover-dynamic2inline/tests_rollover_dynamic2inline.py +++ b/bin/tests/system/rollover-dynamic2inline/tests_rollover_dynamic2inline.py @@ -11,14 +11,9 @@ # pylint: disable=redefined-outer-name,unused-import +from rollover.common import CDSS, DEFAULT_CONFIG, alg, pytestmark, size + import isctest -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - DEFAULT_CONFIG, -) def test_dynamic2inline(alg, size, ns3, templates): diff --git a/bin/tests/system/rollover-enable-dnssec/tests_rollover_enable_dnssec.py b/bin/tests/system/rollover-enable-dnssec/tests_rollover_enable_dnssec.py index 818df48f7df..30d24e403ca 100644 --- a/bin/tests/system/rollover-enable-dnssec/tests_rollover_enable_dnssec.py +++ b/bin/tests/system/rollover-enable-dnssec/tests_rollover_enable_dnssec.py @@ -13,21 +13,12 @@ import pytest -import isctest from isctest.kasp import Ipub, IpubC, Iret from isctest.util import param -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - TIMEDELTA, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_enable_dnssec, -) +from rollover.common import CDSS, TIMEDELTA, alg, pytestmark, size +from rollover.setup import configure_enable_dnssec, configure_root, configure_tld + +import isctest CONFIG = { "dnskey-ttl": TIMEDELTA["PT5M"], diff --git a/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_initial.py b/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_initial.py index fc83ae5beb9..a521948fc23 100644 --- a/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_initial.py +++ b/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_initial.py @@ -13,20 +13,10 @@ import pytest +from rollover.common import CDSS, DURATION, UNSIGNING_CONFIG, alg, pytestmark, size +from rollover.setup import configure_going_insecure, configure_root, configure_tld + import isctest -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - DURATION, - UNSIGNING_CONFIG, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_going_insecure, -) def bootstrap(): diff --git a/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_reconfig.py b/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_reconfig.py index 485d70d434f..9fb23b19877 100644 --- a/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_reconfig.py +++ b/bin/tests/system/rollover-going-insecure/tests_rollover_going_insecure_reconfig.py @@ -13,21 +13,18 @@ import pytest -import isctest from rollover.common import ( - pytestmark, - alg, - size, CDSS, DEFAULT_CONFIG, DURATION, UNSIGNING_CONFIG, + alg, + pytestmark, + size, ) -from rollover.setup import ( - configure_root, - configure_tld, - configure_going_insecure, -) +from rollover.setup import configure_going_insecure, configure_root, configure_tld + +import isctest def bootstrap(): 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 07c36d1bb05..07710d19b07 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 @@ -13,22 +13,19 @@ from datetime import timedelta -import isctest from isctest.kasp import KeyTimingMetadata from rollover.common import ( - pytestmark, - alg, - size, KSK_CONFIG, - KSK_LIFETIME_POLICY, KSK_IPUB, KSK_IRET, + KSK_LIFETIME_POLICY, + alg, + pytestmark, + size, ) -from rollover.setup import ( - configure_root, - configure_tld, - configure_ksk_3crowd, -) +from rollover.setup import configure_ksk_3crowd, configure_root, configure_tld + +import isctest CDSS = ["CDS (SHA-256)"] POLICY = "ksk-doubleksk-autosign" diff --git a/bin/tests/system/rollover-ksk-doubleksk/tests_rollover_ksk_doubleksk.py b/bin/tests/system/rollover-ksk-doubleksk/tests_rollover_ksk_doubleksk.py index 8ef59716a3b..8eccb702d72 100644 --- a/bin/tests/system/rollover-ksk-doubleksk/tests_rollover_ksk_doubleksk.py +++ b/bin/tests/system/rollover-ksk-doubleksk/tests_rollover_ksk_doubleksk.py @@ -15,26 +15,23 @@ from datetime import timedelta import pytest -import isctest from isctest.util import param from rollover.common import ( - pytestmark, - alg, - size, KSK_CONFIG, - KSK_LIFETIME, - KSK_LIFETIME_POLICY, KSK_IPUB, KSK_IPUBC, KSK_IRET, KSK_KEYTTLPROP, + KSK_LIFETIME, + KSK_LIFETIME_POLICY, TIMEDELTA, + alg, + pytestmark, + size, ) -from rollover.setup import ( - configure_root, - configure_tld, - configure_ksk_doubleksk, -) +from rollover.setup import configure_ksk_doubleksk, configure_root, configure_tld + +import isctest CDSS = ["CDS (SHA-256)"] POLICY = "ksk-doubleksk" diff --git a/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_initial.py b/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_initial.py index 8f24c13b91e..a770814f8ad 100644 --- a/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_initial.py +++ b/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_initial.py @@ -13,16 +13,10 @@ import pytest -import isctest from isctest.util import param -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - DEFAULT_CONFIG, - DURATION, -) +from rollover.common import CDSS, DEFAULT_CONFIG, DURATION, alg, pytestmark, size + +import isctest @pytest.mark.parametrize( diff --git a/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_reconfig.py b/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_reconfig.py index 77529993c66..ff697a05293 100644 --- a/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_reconfig.py +++ b/bin/tests/system/rollover-lifetime/tests_rollover_lifetime_reconfig.py @@ -13,16 +13,10 @@ import pytest -import isctest from isctest.util import param -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - DEFAULT_CONFIG, - DURATION, -) +from rollover.common import CDSS, DEFAULT_CONFIG, DURATION, alg, pytestmark, size + +import isctest @pytest.fixture(scope="module", autouse=True) diff --git a/bin/tests/system/rollover-multisigner/tests_rollover_multisigner.py b/bin/tests/system/rollover-multisigner/tests_rollover_multisigner.py index c1445ea6bf8..39cca867f24 100644 --- a/bin/tests/system/rollover-multisigner/tests_rollover_multisigner.py +++ b/bin/tests/system/rollover-multisigner/tests_rollover_multisigner.py @@ -12,23 +12,20 @@ # pylint: disable=redefined-outer-name,unused-import from datetime import timedelta -import os -import pytest +import os import dns import dns.update +import pytest -import isctest from isctest.kasp import Iret, SettimeOptions from isctest.run import EnvCmd -from rollover.common import ( - pytestmark, - alg, - size, -) +from rollover.common import alg, pytestmark, size from rollover.setup import fake_lifetime, render_and_sign_zone, setkeytimes +import isctest + def bootstrap(): templates = isctest.template.TemplateEngine(".") diff --git a/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_initial.py b/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_initial.py index 7a364c3149f..8d63204a99d 100644 --- a/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_initial.py +++ b/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_initial.py @@ -13,20 +13,10 @@ import pytest +from rollover.common import CDSS, DEFAULT_CONFIG, DURATION, alg, pytestmark, size +from rollover.setup import configure_root, configure_straight2none, configure_tld + import isctest -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - DURATION, - DEFAULT_CONFIG, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_straight2none, -) def bootstrap(): diff --git a/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_reconfig.py b/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_reconfig.py index d54d98d65a3..b4bc988a3d8 100644 --- a/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_reconfig.py +++ b/bin/tests/system/rollover-straight2none/tests_rollover_straight2none_reconfig.py @@ -13,20 +13,10 @@ import pytest +from rollover.common import CDSS, DEFAULT_CONFIG, DURATION, alg, pytestmark, size +from rollover.setup import configure_root, configure_straight2none, configure_tld + import isctest -from rollover.common import ( - pytestmark, - alg, - size, - CDSS, - DURATION, - DEFAULT_CONFIG, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_straight2none, -) def bootstrap(): diff --git a/bin/tests/system/rollover-zsk-prepub/tests_rollover_zsk_prepublication.py b/bin/tests/system/rollover-zsk-prepub/tests_rollover_zsk_prepublication.py index 9a2f19b3ba8..4ac6f673135 100644 --- a/bin/tests/system/rollover-zsk-prepub/tests_rollover_zsk_prepublication.py +++ b/bin/tests/system/rollover-zsk-prepub/tests_rollover_zsk_prepublication.py @@ -15,20 +15,12 @@ from datetime import timedelta import pytest -import isctest from isctest.kasp import Ipub, Iret from isctest.util import param -from rollover.common import ( - pytestmark, - alg, - size, - TIMEDELTA, -) -from rollover.setup import ( - configure_root, - configure_tld, - configure_zsk_prepub, -) +from rollover.common import TIMEDELTA, alg, pytestmark, size +from rollover.setup import configure_root, configure_tld, configure_zsk_prepub + +import isctest CONFIG = { "dnskey-ttl": TIMEDELTA["PT1H"], diff --git a/bin/tests/system/rollover/common.py b/bin/tests/system/rollover/common.py index 23612234e44..224d6a5560a 100644 --- a/bin/tests/system/rollover/common.py +++ b/bin/tests/system/rollover/common.py @@ -10,6 +10,7 @@ # information regarding copyright ownership. from datetime import timedelta + import os import pytest diff --git a/bin/tests/system/rollover/setup.py b/bin/tests/system/rollover/setup.py index 469c9682ba0..53cc97e3acd 100644 --- a/bin/tests/system/rollover/setup.py +++ b/bin/tests/system/rollover/setup.py @@ -9,15 +9,17 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import shutil from typing import List -import isctest -from isctest.kasp import private_type_record, SettimeOptions -from isctest.template import Nameserver, TrustAnchor, Zone +import shutil + +from isctest.kasp import SettimeOptions, private_type_record from isctest.run import EnvCmd +from isctest.template import Nameserver, TrustAnchor, Zone from rollover.common import default_algorithm +import isctest + def configure_tld(zonename: str, delegations: List[Zone]) -> Zone: templates = isctest.template.TemplateEngine(".") diff --git a/bin/tests/system/rollover/tests_rollover_manual.py b/bin/tests/system/rollover/tests_rollover_manual.py index 37cf3e6131b..ae32dbf0e9a 100644 --- a/bin/tests/system/rollover/tests_rollover_manual.py +++ b/bin/tests/system/rollover/tests_rollover_manual.py @@ -10,25 +10,22 @@ # information regarding copyright ownership. from datetime import timedelta + import os -import isctest from isctest.kasp import ( - KeyTimingMetadata, Ipub, Iret, - private_type_record, + KeyTimingMetadata, SettimeOptions, + private_type_record, ) -from isctest.template import Nameserver, Zone from isctest.run import EnvCmd - +from isctest.template import Nameserver, Zone from rollover.common import default_algorithm -from rollover.setup import ( - configure_root, - configure_tld, - setkeytimes, -) +from rollover.setup import configure_root, configure_tld, setkeytimes + +import isctest def setup_zone(zone, ksk_time, ksk_timings, zsk_time, zsk_timings) -> Zone: diff --git a/bin/tests/system/rpzextra/tests_rpzextra.py b/bin/tests/system/rpzextra/tests_rpzextra.py index dc2353d039a..5eedc45e274 100644 --- a/bin/tests/system/rpzextra/tests_rpzextra.py +++ b/bin/tests/system/rpzextra/tests_rpzextra.py @@ -13,11 +13,10 @@ import os -import pytest - import dns import dns.rcode import dns.rrset +import pytest import isctest diff --git a/bin/tests/system/rrsig/tests_rrsig.py b/bin/tests/system/rrsig/tests_rrsig.py index c7b7ec1f69c..6a23b2d37e1 100644 --- a/bin/tests/system/rrsig/tests_rrsig.py +++ b/bin/tests/system/rrsig/tests_rrsig.py @@ -9,10 +9,11 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import isctest +from dns import rdatatype import pytest -from dns import rdatatype + +import isctest @pytest.mark.parametrize( diff --git a/bin/tests/system/selftest/tests_zone_analyzer.py b/bin/tests/system/selftest/tests_zone_analyzer.py index 90f76b8416e..671ca877518 100755 --- a/bin/tests/system/selftest/tests_zone_analyzer.py +++ b/bin/tests/system/selftest/tests_zone_analyzer.py @@ -14,13 +14,15 @@ isctest.name.ZoneAnalyzer self-test Generate insane test zone and check expected output of ZoneAnalyzer utility class """ +from pathlib import Path + import collections import itertools -from pathlib import Path + +from dns.name import Name import dns import dns.name -from dns.name import Name import pytest import isctest diff --git a/bin/tests/system/showconf/tests_showconf.py b/bin/tests/system/showconf/tests_showconf.py index e7dff5c7483..b8bab680b62 100644 --- a/bin/tests/system/showconf/tests_showconf.py +++ b/bin/tests/system/showconf/tests_showconf.py @@ -10,6 +10,7 @@ # information regarding copyright ownership. import dns + import isctest diff --git a/bin/tests/system/shutdown/tests_shutdown.py b/bin/tests/system/shutdown/tests_shutdown.py index 2b5b9d52209..831f85c449f 100755 --- a/bin/tests/system/shutdown/tests_shutdown.py +++ b/bin/tests/system/shutdown/tests_shutdown.py @@ -12,17 +12,17 @@ # information regarding copyright ownership. from concurrent.futures import ThreadPoolExecutor, as_completed +from string import ascii_lowercase as letters + import os import random import signal import subprocess -from string import ascii_lowercase as letters import time -import pytest - import dns import dns.exception +import pytest import isctest diff --git a/bin/tests/system/statschannel/generic.py b/bin/tests/system/statschannel/generic.py index 09a374e1207..3e317087ebd 100644 --- a/bin/tests/system/statschannel/generic.py +++ b/bin/tests/system/statschannel/generic.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from datetime import datetime, timedelta from collections import defaultdict +from datetime import datetime, timedelta from time import sleep + import os import dns.message diff --git a/bin/tests/system/statschannel/tests_xml.py b/bin/tests/system/statschannel/tests_xml.py index 1ceb46f9b4b..0707681de7f 100755 --- a/bin/tests/system/statschannel/tests_xml.py +++ b/bin/tests/system/statschannel/tests_xml.py @@ -12,6 +12,7 @@ # information regarding copyright ownership. from datetime import datetime + import xml.etree.ElementTree as ET import pytest diff --git a/bin/tests/system/synthrecord/tests_synthrecord.py b/bin/tests/system/synthrecord/tests_synthrecord.py index f202f5b765e..7fbd5d7f0cc 100644 --- a/bin/tests/system/synthrecord/tests_synthrecord.py +++ b/bin/tests/system/synthrecord/tests_synthrecord.py @@ -13,24 +13,23 @@ # https://github.com/pylint-dev/pylint/issues/10785#issuecomment-3677224217 # pylint: disable=unreachable +from ipaddress import IPv4Address, IPv6Address + import glob import os import subprocess -from ipaddress import IPv4Address, IPv6Address - -import pytest +from dns.reversename import ipv4_reverse_domain, ipv6_reverse_domain +from hypothesis import assume, example, given +from hypothesis.strategies import ip_addresses import dns.message import dns.reversename -from dns.reversename import ipv4_reverse_domain -from dns.reversename import ipv6_reverse_domain +import pytest -import isctest from isctest.hypothesis.strategies import dns_names -from hypothesis import assume, given, example -from hypothesis.strategies import ip_addresses +import isctest SERVER = "10.53.0.1" diff --git a/bin/tests/system/tcp/tests_tcp.py b/bin/tests/system/tcp/tests_tcp.py index 25ee0d0e1bf..c8b301f8a87 100644 --- a/bin/tests/system/tcp/tests_tcp.py +++ b/bin/tests/system/tcp/tests_tcp.py @@ -17,11 +17,10 @@ import socket import struct import time -import pytest - import dns import dns.message import dns.query +import pytest pytestmark = pytest.mark.extra_artifacts( [ diff --git a/bin/tests/system/timeouts/tests_tcp_timeouts.py b/bin/tests/system/timeouts/tests_tcp_timeouts.py index ca982ef6c9f..5b3e67c6d37 100644 --- a/bin/tests/system/timeouts/tests_tcp_timeouts.py +++ b/bin/tests/system/timeouts/tests_tcp_timeouts.py @@ -16,8 +16,6 @@ import socket import time -import pytest - import dns import dns.edns import dns.message @@ -25,6 +23,7 @@ import dns.name import dns.query import dns.rdataclass import dns.rdatatype +import pytest import isctest.mark # pylint: disable=import-error diff --git a/bin/tests/system/tools/tests_tools_nsec3hash.py b/bin/tests/system/tools/tests_tools_nsec3hash.py index 93670bc48ca..d1dd1de053a 100644 --- a/bin/tests/system/tools/tests_tools_nsec3hash.py +++ b/bin/tests/system/tools/tests_tools_nsec3hash.py @@ -12,15 +12,15 @@ import os import subprocess +from dns.dnssectypes import NSEC3Hash +from hypothesis import given, settings, strategies + +import dns.dnssec import pytest -import isctest from isctest.hypothesis.strategies import dns_names -from hypothesis import strategies, given, settings - -from dns.dnssectypes import NSEC3Hash -import dns.dnssec +import isctest NSEC3HASH = os.environ.get("NSEC3HASH") diff --git a/bin/tests/system/tsig/tests_badtime.py b/bin/tests/system/tsig/tests_badtime.py index 4c3a62c9d85..60a47f55cbe 100644 --- a/bin/tests/system/tsig/tests_badtime.py +++ b/bin/tests/system/tsig/tests_badtime.py @@ -16,11 +16,10 @@ import socket import time -import pytest - import dns.message import dns.query import dns.tsigkeyring +import pytest pytestmark = pytest.mark.extra_artifacts( [ diff --git a/bin/tests/system/tsig/tests_tsig_hypothesis.py b/bin/tests/system/tsig/tests_tsig_hypothesis.py index 5d31b58339c..a7107c87fc7 100644 --- a/bin/tests/system/tsig/tests_tsig_hypothesis.py +++ b/bin/tests/system/tsig/tests_tsig_hypothesis.py @@ -17,7 +17,8 @@ import time -import pytest +from hypothesis import assume, example, given +from hypothesis.strategies import binary, booleans, composite, just, sampled_from import dns.exception import dns.message @@ -27,12 +28,11 @@ import dns.rdatatype import dns.rdtypes.ANY.TSIG import dns.rrset import dns.tsig +import pytest -import isctest from isctest.hypothesis.strategies import dns_names, uint -from hypothesis import assume, example, given -from hypothesis.strategies import binary, booleans, composite, just, sampled_from +import isctest pytestmark = pytest.mark.extra_artifacts( [ diff --git a/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py b/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py index 7e960ba6e1c..01e86e0fa9b 100755 --- a/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py +++ b/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py @@ -20,10 +20,6 @@ import argparse import struct import time -import pytest - -import isctest - import dns import dns.message import dns.name @@ -31,6 +27,9 @@ import dns.rdata import dns.rdataclass import dns.rdatatype import dns.rrset +import pytest + +import isctest pytestmark = pytest.mark.extra_artifacts( [ diff --git a/bin/tests/system/verify/tests_verify.py b/bin/tests/system/verify/tests_verify.py index e5e780a5324..2fe4d30b2fd 100644 --- a/bin/tests/system/verify/tests_verify.py +++ b/bin/tests/system/verify/tests_verify.py @@ -9,9 +9,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from re import compile as Re + import os import re -from re import compile as Re import pytest diff --git a/bin/tests/system/wildcard/tests_wildcard.py b/bin/tests/system/wildcard/tests_wildcard.py index 60d75384f03..dfe0dc83148 100755 --- a/bin/tests/system/wildcard/tests_wildcard.py +++ b/bin/tests/system/wildcard/tests_wildcard.py @@ -31,7 +31,7 @@ Limitations - untested properties: # https://github.com/pylint-dev/pylint/issues/10785#issuecomment-3677224217 # pylint: disable=unreachable -import pytest +from hypothesis import assume, example, given, settings import dns import dns.message @@ -41,9 +41,9 @@ import dns.rcode import dns.rdataclass import dns.rdatatype import dns.rrset +import pytest from isctest.hypothesis.strategies import dns_names, dns_rdatatypes_without_meta -from hypothesis import assume, example, given, settings import isctest.check import isctest.name diff --git a/bin/tests/system/xfer/ans10/ans.py b/bin/tests/system/xfer/ans10/ans.py index 6f5346ff86c..d162070c76a 100644 --- a/bin/tests/system/xfer/ans10/ans.py +++ b/bin/tests/system/xfer/ans10/ans.py @@ -9,10 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from isctest.asyncserver import ( - AsyncDnsServer, - IgnoreAllQueries, -) +from isctest.asyncserver import AsyncDnsServer, IgnoreAllQueries def main() -> None: diff --git a/bin/tests/system/xfer/ans9/ans.py b/bin/tests/system/xfer/ans9/ans.py index 2e3a1f8be22..269afafe228 100644 --- a/bin/tests/system/xfer/ans9/ans.py +++ b/bin/tests/system/xfer/ans9/ans.py @@ -19,10 +19,10 @@ import dns.rrset from isctest.asyncserver import ( ControllableAsyncDnsServer, + DnsResponseSend, DomainHandler, QueryContext, ResponseAction, - DnsResponseSend, ToggleResponsesCommand, ) diff --git a/bin/tests/system/xfer/tests_xfer.py b/bin/tests/system/xfer/tests_xfer.py index d8ae3ec8f86..d3c16cc24d4 100644 --- a/bin/tests/system/xfer/tests_xfer.py +++ b/bin/tests/system/xfer/tests_xfer.py @@ -10,18 +10,19 @@ # information regarding copyright ownership. +from re import compile as Re + import fileinput import os -from re import compile as Re import socket import time +import dns.message import pytest -import isctest from isctest.util import param -import dns.message +import isctest NEW_SOA_SERIAL = 1397051953 OLD_SOA_SERIAL = 1397051952 diff --git a/bin/tests/system/xferquota/tests_xferquota.py b/bin/tests/system/xferquota/tests_xferquota.py index a0d042d1356..ba599471d5d 100644 --- a/bin/tests/system/xferquota/tests_xferquota.py +++ b/bin/tests/system/xferquota/tests_xferquota.py @@ -9,10 +9,11 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from re import compile as Re + import glob import os import re -from re import compile as Re import shutil import signal import time diff --git a/bin/tests/system/zero/ans5/ans.py b/bin/tests/system/zero/ans5/ans.py index a7f63913cf8..ad4a4e3ffda 100644 --- a/bin/tests/system/zero/ans5/ans.py +++ b/bin/tests/system/zero/ans5/ans.py @@ -11,9 +11,10 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -import ipaddress from typing import AsyncGenerator +import ipaddress + import dns.rcode import dns.rdatatype import dns.rrset diff --git a/doc/arm/_ext/iscconf.py b/doc/arm/_ext/iscconf.py index 06ade142692..0fe566a5482 100644 --- a/doc/arm/_ext/iscconf.py +++ b/doc/arm/_ext/iscconf.py @@ -23,9 +23,8 @@ https://www.sphinx-doc.org/en/master/development/tutorials/recipe.html from collections import namedtuple -from docutils.parsers.rst import Directive, directives from docutils import nodes - +from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.directives import ObjectDescription from sphinx.domains import Domain diff --git a/doc/arm/_ext/mergegrammar.py b/doc/arm/_ext/mergegrammar.py index e8aaac38931..7a8d8b985c6 100644 --- a/doc/arm/_ext/mergegrammar.py +++ b/doc/arm/_ext/mergegrammar.py @@ -13,9 +13,10 @@ # Depends on CWD - Sphinx plugin -import json from pathlib import Path +import json + import parsegrammar misc_path = Path(__file__).resolve().parent.parent.parent / "misc" diff --git a/doc/misc/checkgrammar.py b/doc/misc/checkgrammar.py index 09984eceb45..f08c1e43dda 100644 --- a/doc/misc/checkgrammar.py +++ b/doc/misc/checkgrammar.py @@ -20,6 +20,7 @@ vs. '( unlimited | ) used in options. from collections import namedtuple from itertools import groupby + import fileinput import parsegrammar diff --git a/pyproject.toml b/pyproject.toml index 9946ac8df80..bb87900d7e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,8 @@ ignore_names = [ [tool.ruff] target-version = "py310" lint.select = [ + # import order + "I", # f-strings "UP031", "UP032", @@ -101,3 +103,12 @@ extend-exclude = [ "doc/arm/conf.py", "doc/man/conf.py", ] +src = [ + "bin/tests/system", + "doc/misc", + "doc/arm/_ext", +] +[tool.ruff.lint.isort] +from-first = true +lines-between-types = 1 +split-on-trailing-comma = false