pytest-smtp-test-server
pytest plugin for using smtp-test-server as pytest mock fixtures.
Installation
Installation with "pip"
pip install pytest-smtp-test-server
Installation with "poetry"
poetry add --group dev pytest-smtp-test-server
Usage
After installation, one could easily use one of the provided fixtures in your pytest test case:
def test_mail_sending(smtp_mock):
my_mail_sending_method(host=smtp_mock.host, port=smtp_mock.port)
assert len(smtp_mock.messages) == 1
Scopes
Fixtures are provided for different pytest fixture scopes for your convenience:
| fixture name | pytest fixture scope |
|---|---|
smtp_mock |
function |
class_smtp_mock |
class |
module_smtp_mock |
module |
package_smtp_mock |
package |
session_smtp_mock |
session |
If you require more control over hosts and ports, consider using
smtp-test-server directly.
Metadata
Release files for pytest-smtp-test-server 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_smtp_test_server-0.1.1.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_smtp_test_server-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / pytest_smtp_test_server-0.1.1.tar.gz
| Download URL | pytest_smtp_test_server-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
839fb60ebde6f1adec2668cabc2e85c0624e8a857ebde2bdaad5d6234d897190
|
|
BLAKE2b-256 checksum How to use checksums |
2cc6b79c6229fcd823a3a2f0e150eb011ce73ff321840356088b409a48812d59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.4 Darwin/23.1.0
|
Release files / pytest_smtp_test_server-0.1.1-py3-none-any.whl
| Download URL | pytest_smtp_test_server-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6065b184e182078f89c201aa30bd33d8c8abe5194f7c5ddfea92e525be5b566
|
|
BLAKE2b-256 checksum How to use checksums |
1d1cb6934952fa8e9dc6e776fd4519923935badde4b9b816fc4511a403206a95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.4 Darwin/23.1.0
|