-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTPD_USE_SSL only honored when set in a separate fixture #50
Comments
bebleo
added a commit
that referenced
this issue
Mar 5, 2021
Until a fix is implemented for issue #50 add it to the known issues list.
bebleo
added a commit
that referenced
this issue
Mar 5, 2021
Until a fix is implemented for issue #50 add it to the known issues list.
Thanks @jwodder for taking the time to report this issue! 🎉 As of version 0.3.0 this behaviour can now be handled by setting the def test_smtpd_ssl(smtpd):
smtpd.confg.use_ssl = True # Not using monkeypatch!
client = smtplib.SMTP_SSL(smtpd.hostname, smtpd.port)
msg = EmailMessage()
msg["Subject"] = "Hello, World!"
msg["To"] = "world@earth.space"
msg["From"] = "me@here.qq"
msg.set_content("Hi, world! How you doin'?\n")
client.send_message(msg)
client.quit()
assert len(smtpd.messages) == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Python 3.9.2 on macOS 11.2.1, using pytest 6.2.2 and smtpdfix 0.2.9, the following fails on the
client = smtplib.SMTP_SSL(...)
line with an SSL error:Meanwhile, setting
SMTPD_USE_SSL
outside of the test in a fixture succeeds:This is presumably not the intended way to set
SMTPD_USE_SSL
, and so I am reporting it as a bug.The text was updated successfully, but these errors were encountered: