diff --git a/tests/test_connect.py b/tests/test_connect.py index afad614a..686bed18 100644 --- a/tests/test_connect.py +++ b/tests/test_connect.py @@ -54,7 +54,8 @@ async def handle_client(self): with pytest.raises(SMTPConnectError): await smtp_client.connect() - smtp_client.close() + assert smtp_client.transport is None + assert smtp_client.protocol is None async def test_421_closes_connection( diff --git a/tests/test_timeouts.py b/tests/test_timeouts.py index 0177833d..7bb8b49c 100644 --- a/tests/test_timeouts.py +++ b/tests/test_timeouts.py @@ -48,6 +48,9 @@ async def test_timeout_error_on_connect( with pytest.raises(SMTPTimeoutError): await smtp_client.connect(timeout=0.01) + assert smtp_client.transport is None + assert smtp_client.protocol is None + async def test_timeout_on_initial_read( smtp_client, smtpd_server, smtpd_class, event_loop, monkeypatch