❤️ TEST-#37: Add coverage for resolve_smtp_host (known + DNS + fallback) - #81
Merged
Conversation
FernandoCelmer
commented
May 17, 2026
FernandoCelmer
left a comment
Member
Author
There was a problem hiding this comment.
🔍 Code Review
Code issues found: 0
Test-only PR. Coverage matrix for resolve_smtp_host is now exhaustive:
- All
KNOWN_SMTP_PROVIDERSaliases (gmail/googlemail/o365 family/icloud family/yahoo/ymail/zoho/hostinger/fastmail/aol) _split_emailrejection branches_lookup_smtp_srv: no-DNS short-circuit, exception, SRV→465 (SSL), SRV→587 (STARTTLS)_lookup_smtp_mx: hint match + no-hint-match + DNS exception- Resolution order asserts (known wins over DNS, SRV wins over MX)
_Target / _srv / _mx helpers mirror the dnspython shapes cleanly. No production code touched; risk is zero.
Closes #37.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expanded
tests/test_providers_smtp.pyfrom 6 cases to 26 covering every branch in SMTP host resolution:KNOWN_SMTP_PROVIDERSaliases (gmail/googlemail, office365 family, icloud family, yahoo/ymail, zoho, hostinger, fastmail, aol)_split_emailrejection paths: missing@, missing local part, missing domain_lookup_smtp_srv: no-dns short-circuit, DNS exception, SRV→465 SSL, SRV→587 STARTTLS_lookup_smtp_mx: no-dns short-circuit, DNS exception, hint match (aspmx.l.google.com→ smtp.gmail.com), no-hint match returns Nonesmtp.<domain>on 465/SSL) when DNS unavailableSMTP_MX_HINTSpopulated,ProviderResolutionErrorsubclassCloses #37
Test plan
pytest tests/test_providers_smtp.py— 26 passed