1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Roman Inflianskas <rominf@pm.me>
Date: Fri, 28 Jun 2024 07:42:33 +0300
Subject: Add compatibility for Python 3.13
Closes https://github.com/aio-libs/aiosmtpd/issues/403.
Origin: https://github.com/aio-libs/aiosmtpd/pull/473/commits/83e2701e41936c3a890d2a6de4cd4a513e1b5558
Bug: https://github.com/aio-libs/aiosmtpd/issues/403
Bug-Debian: https://bugs.debian.org/1082193
Last-Update: 2024-12-10
---
aiosmtpd/tests/test_server.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/aiosmtpd/tests/test_server.py b/aiosmtpd/tests/test_server.py
index 443c083..d2251d4 100644
--- a/aiosmtpd/tests/test_server.py
+++ b/aiosmtpd/tests/test_server.py
@@ -448,10 +448,17 @@ class TestUnthreaded:
# Stop the task
cont.end()
catchup_delay()
- # Now the listener has gone away
- # noinspection PyTypeChecker
- with pytest.raises((socket.timeout, ConnectionError)):
- assert_smtp_socket(cont)
+ if sys.version_info < (3, 13):
+ # Now the listener has gone away
+ # noinspection PyTypeChecker
+ with pytest.raises((socket.timeout, ConnectionError)):
+ assert_smtp_socket(cont)
+ else:
+ # Starting from Python 3.13, listening asyncio Unix socket is
+ # removed on close, see:
+ # https://github.com/python/cpython/issues/111246
+ # https://github.com/python/cpython/pull/111483
+ assert not Path(cont.unix_socket).exists()
@pytest.mark.filterwarnings(
"ignore::pytest.PytestUnraisableExceptionWarning"
|