MailTest
MailTest is a Python unittesting library that for code that sends email. It starts a local SMTP server inside a Python with block, and captures all the email sent to it. These emails can then be read within the block.
Example:
with mailtest.Server() as mt:
send_welcome_email()
assert len(mt.emails) == 1
Install
pip3 install mailtest
Configuration
Configuration is done via kwargs to mailtest.Server(). Options: - smtp_port (default: 1025) - sendgrid_port (default: None)
Speed
MailTest can test receive approx. 4000 emails/second on an Intel(R) Core(TM) i5-7260U CPU @ 2.20GHz.
Testing
$ python2 test.py .. ---------------------------------------------------------------------- Ran 2 tests in 0.269s OK
$ python3 test.py .. ---------------------------------------------------------------------- Ran 2 tests in 0.543s OK
Metadata
Release files for mailtest 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mailtest-1.1.3.tar.gz | 2.8 kB | Without provenance | Details for mailtest-1.1.3.tar.gz |
Release files / mailtest-1.1.3.tar.gz
| Download URL | mailtest-1.1.3.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6affa0e4a7f3de5f029731827cfa0fae9d45751aefb67d773ebbe2dee13ef80d
|
|
BLAKE2b-256 checksum How to use checksums |
0b849fef9cb5d64f469858b202b084e97398ec8930c43758840b16a4c4fa44a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mailtest 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.