← Commit list

98e470b3a8

Dan Fandrich
Dan Fandrich
2026-04-08
SUCCESS Duration: 262s

Subject

tests: alphabetize and group Python imports & add check

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

scripts/pythonlint.sh+1 -1
@@ -29,5 +29,5 @@
ruff check --extend-select=B007,B016,C405,C416,COM818,D200,D213,D204,D401,\
D415,FURB129,N818,PERF401,PERF403,PIE790,PIE808,PLW0127,Q004,RUF010,SIM101,\
-SIM117,SIM118,TRY400,TRY401,RET503,RET504,UP004,B018,B904,RSE102,RET505 \
+SIM117,SIM118,TRY400,TRY401,RET503,RET504,UP004,B018,B904,RSE102,RET505,I001 \
"$@"
tests/dictserver.py+1 -2
@@ -26,8 +26,7 @@
#
"""DICT server."""
-from __future__ import (absolute_import, division, print_function,
- unicode_literals)
+from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
tests/http/conftest.py+2 -3
@@ -24,17 +24,16 @@
#
import logging
import os
-import sys
import platform
+import sys
from typing import Generator, Union
import pytest
-
from testenv.env import EnvConfig
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
-from testenv import Env, Nghttpx, Httpd, NghttpxQuic, NghttpxFwd, Sshd
+from testenv import Env, Httpd, Nghttpx, NghttpxFwd, NghttpxQuic, Sshd
log = logging.getLogger(__name__)
tests/http/scorecard.py+12 -3
@@ -32,9 +32,18 @@ import os
import re
import sys
from statistics import mean
-from typing import Dict, Any, Optional, List
-
-from testenv import Env, Httpd, CurlClient, Caddy, ExecResult, NghttpxQuic, RunProfile, Dante
+from typing import Any, Dict, List, Optional
+
+from testenv import (
+ Caddy,
+ CurlClient,
+ Dante,
+ Env,
+ ExecResult,
+ Httpd,
+ NghttpxQuic,
+ RunProfile,
+)
log = logging.getLogger(__name__)
tests/http/test_01_basic.py+2 -4
@@ -26,11 +26,9 @@
#
import logging
import re
-import pytest
-
-from testenv import Env
-from testenv import CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_02_download.py+2 -3
@@ -30,10 +30,9 @@ import logging
import os
import re
import sys
-import pytest
-
-from testenv import Env, CurlClient, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient
log = logging.getLogger(__name__)
tests/http/test_03_goaway.py+2 -3
@@ -28,10 +28,9 @@ import logging
import time
from datetime import timedelta
from threading import Thread
-import pytest
-
-from testenv import Env, CurlClient, ExecResult
+import pytest
+from testenv import CurlClient, Env, ExecResult
log = logging.getLogger(__name__)
tests/http/test_04_stuttered.py+3 -4
@@ -25,11 +25,10 @@
###########################################################################
#
import logging
-from typing import Tuple, List, Dict
-import pytest
-
-from testenv import Env, CurlClient
+from typing import Dict, List, Tuple
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_05_errors.py+2 -3
@@ -26,10 +26,9 @@
#
import logging
import os
-import pytest
-
-from testenv import Env, CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_06_eyeballs.py+2 -3
@@ -26,10 +26,9 @@
#
import logging
import re
-import pytest
-
-from testenv import Env, CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_07_upload.py+2 -3
@@ -30,11 +30,10 @@ import logging
import os
import re
import sys
-import pytest
from typing import List, Union
-from testenv import Env, CurlClient, LocalClient, ExecResult
-
+import pytest
+from testenv import CurlClient, Env, ExecResult, LocalClient
log = logging.getLogger(__name__)
tests/http/test_08_caddy.py+2 -3
@@ -29,10 +29,9 @@ import filecmp
import logging
import os
import re
-import pytest
-
-from testenv import Env, CurlClient, Caddy, LocalClient
+import pytest
+from testenv import Caddy, CurlClient, Env, LocalClient
log = logging.getLogger(__name__)
tests/http/test_09_push.py+2 -3
@@ -26,10 +26,9 @@
#
import logging
import os
-import pytest
-
-from testenv import Env, CurlClient, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient
log = logging.getLogger(__name__)
tests/http/test_10_proxy.py+2 -3
@@ -29,10 +29,9 @@ import logging
import os
import re
import sys
-import pytest
-
-from testenv import Env, CurlClient, ExecResult
+import pytest
+from testenv import CurlClient, Env, ExecResult
log = logging.getLogger(__name__)
tests/http/test_11_unix.py+1 -3
@@ -31,9 +31,7 @@ from threading import Thread
from typing import Generator
import pytest
-
-from testenv import Env, CurlClient
-
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_12_reuse.py+2 -3
@@ -25,10 +25,9 @@
###########################################################################
#
import logging
-import pytest
-
-from testenv import Env, CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_13_proxy_auth.py+2 -3
@@ -27,10 +27,9 @@
import logging
import os
import re
-import pytest
-
-from testenv import Env, CurlClient, ExecResult
+import pytest
+from testenv import CurlClient, Env, ExecResult
log = logging.getLogger(__name__)
tests/http/test_14_auth.py+2 -3
@@ -26,10 +26,9 @@
#
import logging
import os
-import pytest
-
-from testenv import Env, CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_15_tracing.py+2 -4
@@ -26,11 +26,9 @@
#
import logging
import re
-import pytest
-
-from testenv import Env
-from testenv import CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_16_info.py+2 -3
@@ -26,10 +26,9 @@
#
import logging
import os
-import pytest
-
-from testenv import Env, CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_17_ssl_use.py+2 -3
@@ -28,10 +28,9 @@ import json
import logging
import os
import re
-import pytest
-
-from testenv import Env, CurlClient, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient
log = logging.getLogger(__name__)
tests/http/test_18_methods.py+2 -3
@@ -25,10 +25,9 @@
###########################################################################
#
import logging
-import pytest
-
-from testenv import Env, CurlClient
+import pytest
+from testenv import CurlClient, Env
log = logging.getLogger(__name__)
tests/http/test_19_shutdown.py+2 -3
@@ -27,10 +27,9 @@
import logging
import os
import re
-import pytest
-
-from testenv import Env, CurlClient, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient
log = logging.getLogger(__name__)
tests/http/test_20_websockets.py+2 -3
@@ -32,12 +32,11 @@ import subprocess
import time
from datetime import datetime, timedelta
from typing import Dict
-import pytest
-from testenv import Env, CurlClient, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient
from testenv.ports import alloc_ports_and_do
-
log = logging.getLogger(__name__)
tests/http/test_21_resolve.py+2 -3
@@ -27,10 +27,9 @@
import logging
import os
from datetime import timedelta
-import pytest
-
-from testenv import Env, CurlClient, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient
log = logging.getLogger(__name__)
tests/http/test_30_vsftpd.py+2 -3
@@ -29,10 +29,9 @@ import filecmp
import logging
import os
import shutil
-import pytest
-
-from testenv import Env, CurlClient, VsFTPD, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient, VsFTPD
log = logging.getLogger(__name__)
tests/http/test_31_vsftpds.py+2 -3
@@ -29,10 +29,9 @@ import filecmp
import logging
import os
import shutil
-import pytest
-
-from testenv import Env, CurlClient, VsFTPD, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient, VsFTPD
log = logging.getLogger(__name__)
tests/http/test_32_ftps_vsftpd.py+2 -3
@@ -29,10 +29,9 @@ import filecmp
import logging
import os
import shutil
-import pytest
-
-from testenv import Env, CurlClient, VsFTPD, LocalClient
+import pytest
+from testenv import CurlClient, Env, LocalClient, VsFTPD
log = logging.getLogger(__name__)
tests/http/test_40_socks.py+2 -3
@@ -28,10 +28,9 @@ import logging
import os
import time
from typing import Generator
-import pytest
-
-from testenv import Env, CurlClient, Dante
+import pytest
+from testenv import CurlClient, Dante, Env
log = logging.getLogger(__name__)
tests/http/test_50_scp.py+2 -3
@@ -28,10 +28,9 @@ import difflib
import filecmp
import logging
import os
-import pytest
-
-from testenv import Env, CurlClient, Sshd
+import pytest
+from testenv import CurlClient, Env, Sshd
log = logging.getLogger(__name__)
tests/http/test_51_sftp.py+2 -3
@@ -28,10 +28,9 @@ import difflib
import filecmp
import logging
import os
-import pytest
-
-from testenv import Env, CurlClient, Sshd
+import pytest
+from testenv import CurlClient, Env, Sshd
log = logging.getLogger(__name__)
tests/http/testenv/__init__.py+9 -6
@@ -25,16 +25,19 @@
###########################################################################
# ruff: noqa: F401, E402
import pytest
+
pytest.register_assert_rewrite("testenv.env", "testenv.curl", "testenv.caddy",
"testenv.httpd", "testenv.nghttpx")
-from .env import Env
-from .certs import TestCA, Credentials
+# This import must be first to avoid circular imports
+from .curl import CurlClient, ExecResult, RunProfile # noqa: I001
+
from .caddy import Caddy
-from .httpd import Httpd
-from .curl import CurlClient, ExecResult, RunProfile
+from .certs import Credentials, TestCA
from .client import LocalClient
-from .nghttpx import Nghttpx, NghttpxQuic, NghttpxFwd
-from .vsftpd import VsFTPD
from .dante import Dante
+from .env import Env
+from .httpd import Httpd
+from .nghttpx import Nghttpx, NghttpxFwd, NghttpxQuic
from .sshd import Sshd
+from .vsftpd import VsFTPD
tests/http/testenv/caddy.py+1 -1
@@ -29,7 +29,7 @@ import os
import socket
import subprocess
import time
-from datetime import timedelta, datetime
+from datetime import datetime, timedelta
from json import JSONEncoder
from typing import Dict
tests/http/testenv/certs.py+8 -4
@@ -30,8 +30,8 @@ import os
import re
import shutil
import subprocess
-from datetime import timedelta, datetime, timezone
-from typing import List, Any, Optional
+from datetime import datetime, timedelta, timezone
+from typing import Any, List, Optional
from cryptography import x509
from cryptography.hazmat.backends import default_backend
@@ -40,10 +40,14 @@ from cryptography.hazmat.primitives._serialization import PublicFormat
from cryptography.hazmat.primitives.asymmetric import ec, rsa
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey
-from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, NoEncryption, load_pem_private_key
+from cryptography.hazmat.primitives.serialization import (
+ Encoding,
+ NoEncryption,
+ PrivateFormat,
+ load_pem_private_key,
+)
from cryptography.x509 import ExtendedKeyUsageOID, NameOID
-
EC_SUPPORTED = {}
EC_SUPPORTED.update([(curve.name.upper(), curve) for curve in [
ec.SECP192R1,
tests/http/testenv/client.py+1 -2
@@ -29,12 +29,11 @@ import os
import shutil
import subprocess
from datetime import datetime
-from typing import Optional, Dict
+from typing import Dict, Optional
from . import ExecResult
from .env import Env
-
log = logging.getLogger(__name__)
tests/http/testenv/curl.py+7 -8
@@ -27,23 +27,22 @@
import json
import logging
import os
+import re
+import shutil
+import subprocess
import sys
import time
+from datetime import datetime, timedelta, timezone
from functools import cmp_to_key
+from statistics import fmean, mean
from threading import Thread
+from typing import Any, Dict, List, Optional, Union
+from urllib.parse import urlparse
import psutil
-import re
-import shutil
-import subprocess
-from statistics import mean, fmean
-from datetime import timedelta, datetime, timezone
-from typing import List, Optional, Dict, Union, Any
-from urllib.parse import urlparse
from .env import Env
-
log = logging.getLogger(__name__)
tests/http/testenv/dante.py+1 -2
@@ -29,8 +29,7 @@ import os
import socket
import subprocess
import time
-from datetime import timedelta, datetime
-
+from datetime import datetime, timedelta
from typing import Dict
from . import CurlClient
tests/http/testenv/env.py+1 -2
@@ -33,14 +33,13 @@ import subprocess
import tempfile
from configparser import ConfigParser, ExtendedInterpolation
from datetime import timedelta
-from typing import Optional, Dict, List
+from typing import Dict, List, Optional
import pytest
from filelock import FileLock
from .certs import CertificateSpec, Credentials, TestCA
-
log = logging.getLogger(__name__)
tests/http/testenv/httpd.py+4 -4
@@ -24,17 +24,17 @@
#
###########################################################################
#
+import copy
import inspect
import logging
import os
import shutil
import socket
import subprocess
-from datetime import timedelta, datetime
-from json import JSONEncoder
import time
-from typing import List, Union, Optional, Dict
-import copy
+from datetime import datetime, timedelta
+from json import JSONEncoder
+from typing import Dict, List, Optional, Union
from .curl import CurlClient, ExecResult
from .env import Env
tests/http/testenv/nghttpx.py+2 -2
@@ -30,11 +30,11 @@ import signal
import socket
import subprocess
import time
-from typing import Optional, Dict
from datetime import datetime, timedelta
+from typing import Dict, Optional
-from .env import Env, NghttpxUtil
from .curl import CurlClient
+from .env import Env, NghttpxUtil
from .ports import alloc_ports_and_do
log = logging.getLogger(__name__)
tests/http/testenv/sshd.py+1 -2
@@ -30,8 +30,7 @@ import socket
import stat
import subprocess
import time
-from datetime import timedelta, datetime
-
+from datetime import datetime, timedelta
from typing import Dict
from . import CurlClient
tests/http/testenv/vsftpd.py+1 -2
@@ -30,9 +30,8 @@ import re
import socket
import subprocess
import time
-
from datetime import datetime, timedelta
-from typing import List, Dict
+from typing import Dict, List
from .curl import CurlClient, ExecResult
from .env import Env
tests/negtelnetserver.py+1 -2
@@ -23,8 +23,7 @@
#
"""A telnet server which negotiates."""
-from __future__ import (absolute_import, division, print_function,
- unicode_literals)
+from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
tests/smbserver.py+2 -3
@@ -24,13 +24,13 @@
"""Server for testing SMB."""
import argparse
+import configparser
import logging
import os
import signal
import sys
import tempfile
import threading
-import configparser
# Import our curl test data helper
from util import ClosingFileHandler, TestData
@@ -45,8 +45,7 @@ except ImportError:
sys.exit(1)
from impacket import smb as imp_smb
from impacket import smbserver as imp_smbserver
-from impacket.nt_errors import (STATUS_ACCESS_DENIED, STATUS_NO_SUCH_FILE,
- STATUS_SUCCESS)
+from impacket.nt_errors import STATUS_ACCESS_DENIED, STATUS_NO_SUCH_FILE, STATUS_SUCCESS
log = logging.getLogger(__name__)
SERVER_MAGIC = "SERVER_MAGIC"