[9.18] fix: ci: Apply black formatting changes

Generated by black 26.1.0 which got updated in CI.

Merge branch 'nicki/python-black-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11473
This commit is contained in:
Nicki Křížek 2026-01-22 09:44:42 +01:00
commit 26557d3ed3
29 changed files with 18 additions and 49 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

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

View file

@ -294,7 +294,7 @@ while running:
if s == query4_tcp1 or s == query6_tcp1 or s == query4_tcp2 or s == query6_tcp2:
try:
(cs, _) = s.accept()
cs, _ = s.accept()
if s == query4_tcp1 or s == query6_tcp1:
print(
"TCP Query received on %s"

View file

@ -55,7 +55,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
CONFTEST_LOGGER = logging.getLogger("conftest")
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

@ -20,7 +20,6 @@ import subprocess
import pytest
long_test = pytest.mark.skipif(
not os.environ.get("CI_ENABLE_LONG_TESTS"), reason="CI_ENABLE_LONG_TESTS not set"
)

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

@ -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.supported_openssl_version,
isctest.mark.softhsm2_environment,

View file

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

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

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

View file

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

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

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.have_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.have_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, HealthCheck, settings
from hypothesis.strategies import binary, booleans, composite, just, sampled_from
pytestmark = pytest.mark.extra_artifacts(
[
"ans*/ans.run",

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

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