From 7dd6b4dc5bbdd3276adb2d7f39addd385f75862c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Wed, 28 Jan 2026 00:01:35 +0100 Subject: [PATCH] Fix 'Import should be placed at the top of the module' In preparation for running pylint on more Python code. (cherry picked from commit 4253d7298c3ba0c4bbd20194bff7d0d4832409c1) --- bin/tests/system/ans.py | 2 -- bin/tests/system/conftest.py | 3 +++ .../system/dnssec-malformed-dnskey/tests_malformed_dnskey.py | 2 -- bin/tests/system/ixfr/ans2/ans.py | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/tests/system/ans.py b/bin/tests/system/ans.py index 9dbdee11c1..6ac5498d1d 100644 --- a/bin/tests/system/ans.py +++ b/bin/tests/system/ans.py @@ -9,9 +9,7 @@ file, you can obtain one at https://mozilla.org/MPL/2.0/. See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. -""" -""" This is a bare-bones DNS server that only serves data from zone files. It is meant to be used as a replacement for full-blown named instances in system tests when a given server is only required to return zone-based data. diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 49126d9788..c00161d39d 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -23,9 +23,12 @@ import pytest pytest.register_assert_rewrite("isctest") +# pylint: disable=wrong-import-position import isctest from isctest.vars.dirs import SYSTEM_TEST_DIR_GIT_PATH +# pylint: enable=wrong-import-position + # Silence warnings caused by passing a pytest fixture to another fixture. # pylint: disable=redefined-outer-name 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 d66644ce7b..2e6c667d22 100644 --- a/bin/tests/system/dnssec-malformed-dnskey/tests_malformed_dnskey.py +++ b/bin/tests/system/dnssec-malformed-dnskey/tests_malformed_dnskey.py @@ -15,8 +15,6 @@ from re import compile as Re import os import pytest -pytest.importorskip("cryptography") - from cryptography.hazmat.primitives.asymmetric import ec import dns diff --git a/bin/tests/system/ixfr/ans2/ans.py b/bin/tests/system/ixfr/ans2/ans.py index 8659244426..37b2291721 100644 --- a/bin/tests/system/ixfr/ans2/ans.py +++ b/bin/tests/system/ixfr/ans2/ans.py @@ -11,6 +11,8 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ +from typing import AsyncGenerator, Collection, Iterable + import abc import dns.rcode @@ -18,8 +20,6 @@ import dns.rdataclass import dns.rdatatype import dns.rrset -from typing import AsyncGenerator, Collection, Iterable - from isctest.asyncserver import ( ControllableAsyncDnsServer, DnsResponseSend,