diff --git a/chatmaild/pyproject.toml b/chatmaild/pyproject.toml index 3c3302c4..28dac0ca 100644 --- a/chatmaild/pyproject.toml +++ b/chatmaild/pyproject.toml @@ -48,6 +48,9 @@ lint.select = [ "PLE", # Pylint Error "PLW", # Pylint Warning ] +lint.ignore = [ + "PLC0415" # import-outside-top-level +] [tool.tox] legacy_tox_ini = """ diff --git a/cmdeploy/pyproject.toml b/cmdeploy/pyproject.toml index 2a33052d..9f2257b5 100644 --- a/cmdeploy/pyproject.toml +++ b/cmdeploy/pyproject.toml @@ -41,3 +41,6 @@ lint.select = [ "PLE", # Pylint Error "PLW", # Pylint Warning ] +lint.ignore = [ + "PLC0415" # import-outside-top-level +] diff --git a/cmdeploy/src/cmdeploy/__init__.py b/cmdeploy/src/cmdeploy/__init__.py index ad8c72b9..73325654 100644 --- a/cmdeploy/src/cmdeploy/__init__.py +++ b/cmdeploy/src/cmdeploy/__init__.py @@ -458,11 +458,7 @@ def check_config(config): def deploy_mtail(config): # Uninstall mtail package, we are going to install a static binary. - apt.packages( - name="Uninstall mtail", - packages=["mtail"], - present=False - ) + apt.packages(name="Uninstall mtail", packages=["mtail"], present=False) (url, sha256sum) = { "x86_64": ( diff --git a/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py b/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py index 0ecfd8c4..80a28c91 100644 --- a/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py +++ b/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py @@ -1,5 +1,6 @@ import datetime import smtplib +import socket import subprocess import pytest @@ -118,14 +119,19 @@ def test_authenticated_from(cmsetup, maildata): @pytest.mark.parametrize("from_addr", ["fake@example.org", "fake@testrun.org"]) def test_reject_missing_dkim(cmsetup, maildata, from_addr): + domain = cmsetup.maildomain + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(10) + try: + sock.connect((domain, 25)) + except socket.timeout: + pytest.skip(f"port 25 not reachable for {domain}") + recipient = cmsetup.gen_users(1)[0] msg = maildata( "encrypted.eml", from_addr=from_addr, to_addr=recipient.addr ).as_string() - try: - conn = smtplib.SMTP(cmsetup.maildomain, 25, timeout=10) - except TimeoutError: - pytest.skip(f"port 25 not reachable for {cmsetup.maildomain}") + conn = smtplib.SMTP(cmsetup.maildomain, 25, timeout=10) with conn as s: with pytest.raises(smtplib.SMTPDataError, match="No valid DKIM signature"):