pytest plugin for using `smtp-test-server` as a fixture
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_smtp_test_server-0.1.0.tar.gz
.
File metadata
- Download URL: pytest_smtp_test_server-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.4 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b34011d8a8597d6b93d8a3ac7ef54532eae84bf2d1bb22ef6debffeb1a332df |
|
MD5 | d59af61101718571da7f4a1c8699a431 |
|
BLAKE2b-256 | e0d32e3fa271e822c896087ab94e375a4b0e9dfdb6b837c468f5ccdc93991dfe |
File details
Details for the file pytest_smtp_test_server-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_smtp_test_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.4 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa153303a015f1310451c9a4b27c63f370d027427354fd1249f08a64ec914943 |
|
MD5 | 3e24143b9078b237a6ab0ad77fa04c9c |
|
BLAKE2b-256 | 1aa7ae1aec81755693cf6e7e0f558627612bfa3d71d6617df811d02dfca5523e |