Apply black formatting changes

Generated by black 26.1.0 which got updated in CI.
This commit is contained in:
Nicki Křížek 2026-01-21 22:39:09 +01:00
parent a2a9b1b878
commit bf303c793e
55 changed files with 17 additions and 76 deletions

View file

@ -24,7 +24,6 @@ from isctest.asyncserver import (
from bailiwick_ans import ResponseSpoofer, spoofing_server
ATTACKER_IP = "10.53.0.3"
TTL = 3600

View file

@ -24,7 +24,6 @@ from isctest.asyncserver import (
from bailiwick_ans import ResponseSpoofer, spoofing_server
ATTACKER_IP = "10.53.0.3"
TTL = 3600

View file

@ -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]"

View file

@ -18,7 +18,6 @@ import dns.message
import isctest
import isctest.mark
pytestmark = pytest.mark.extra_artifacts(
[
"ns*/example*.db",

View file

@ -26,7 +26,6 @@ pytest.register_assert_rewrite("isctest")
import isctest
from isctest.vars.dirs import SYSTEM_TEST_DIR_GIT_PATH
# Silence warnings caused by passing a pytest fixture to another fixture.
# pylint: disable=redefined-outer-name

View file

@ -16,7 +16,6 @@ import dns.flags
import isctest
pytestmark = pytest.mark.extra_artifacts(
[
"ns*/trusted.conf",

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",

View file

@ -14,7 +14,6 @@ from dns import rdataclass, rdatatype
import isctest
ARTIFACTS = [
"conf/*.conf",
"ns*/trusted.conf",

View file

@ -20,7 +20,6 @@ from filters.common import (
prime_cache,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)

View file

@ -20,7 +20,6 @@ from filters.common import (
prime_cache,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)

View file

@ -21,7 +21,6 @@ from filters.common import (
prime_cache,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)

View file

@ -20,7 +20,6 @@ from filters.common import (
prime_cache,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)

View file

@ -19,7 +19,6 @@ import isctest
from filters.common import ARTIFACTS
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)

View file

@ -15,7 +15,6 @@ import isctest
from filters.common import ARTIFACTS
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",

View file

@ -16,7 +16,6 @@ import pytest
import isctest
pytestmark = pytest.mark.extra_artifacts(
[
"ns1/*",

View file

@ -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()

View file

@ -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]
]

View file

@ -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

View file

@ -17,7 +17,6 @@ import time
from isctest.text import compile_pattern, FlexPattern, LineReader
T = TypeVar("T")
OneOrMore = Union[T, List[T]]

View file

@ -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]

View file

@ -14,7 +14,6 @@ import subprocess
from .basic import BASIC_VARS
FEATURES = {
"DNSRPS": "--enable-dnsrps",
"DNSTAP": "--enable-dnstap",

View file

@ -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),

View file

@ -12,7 +12,6 @@
import isctest
import pytest
pytestmark = pytest.mark.extra_artifacts(
["ns2/named.stats"],
)

View file

@ -18,7 +18,6 @@ import pytest
import isctest.mark
pytestmark = [
isctest.mark.softhsm2_environment,
pytest.mark.extra_artifacts(

View file

@ -30,7 +30,6 @@ from nsec3.common import (
check_nsec3_case,
)
# include the following zones when rendering named configs
ZONES = {
"nsec3-change.kasp",

View file

@ -28,7 +28,6 @@ from nsec3.common import (
check_nsec3_case,
)
# include the following zones when rendering named configs
ZONES = {
"nsec-to-nsec3.kasp",

View file

@ -30,7 +30,6 @@ from nsec3.common import (
check_nsec3_case,
)
# include the following zones when rendering named configs
ZONES = {
"nsec3-to-nsec.kasp",

View file

@ -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",

View file

@ -28,7 +28,6 @@ from nsec3.common import (
check_nsec3param,
)
# include the following zones when rendering named configs
ZONES = {
"nsec3.kasp",

View file

@ -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]"

View file

@ -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()

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",

View file

@ -15,7 +15,6 @@ import pytest
import isctest
pytestmark = pytest.mark.extra_artifacts(
[
"ns*/named.pid",

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
".digrc",

View file

@ -18,7 +18,6 @@ import pytest
import isctest
pytestmark = pytest.mark.extra_artifacts(
[
"ns2/nil.db",

View file

@ -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())

View file

@ -21,7 +21,6 @@ import dns.rrset
import isctest
pytestmark = pytest.mark.extra_artifacts(
[
"ns3/*-rpz-external.local.db",

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",

View file

@ -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(
[

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"curl.out.*",

View file

@ -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

View file

@ -21,7 +21,6 @@ import isctest.mark
pytest.register_assert_rewrite("generic")
import generic
pytestmark = [
isctest.mark.with_json_c,
pytest.mark.extra_artifacts(

View file

@ -22,7 +22,6 @@ import isctest.mark
pytest.register_assert_rewrite("generic")
import generic
pytestmark = [
isctest.mark.with_libxml2,
pytest.mark.extra_artifacts(

View file

@ -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:

View file

@ -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(

View file

@ -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",

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"Ksig0.example2*",

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"axfr.out",

View file

@ -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"

View file

@ -11,7 +11,6 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out*",

View file

@ -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

View file

@ -35,7 +35,6 @@ from sphinx.util.nodes import make_refnode
import checkgrammar
logger = logging.getLogger(__name__)

View file

@ -15,6 +15,7 @@
Sphinx domain "namedconf". See iscconf.py for details.
"""
from docutils import nodes
import iscconf

View file

@ -59,6 +59,7 @@ end node, key "_mapbody" denotes a nested map.
}
}
"""
import fileinput
import json
import re