2023-11-29 22:19:19 +01:00
2023-11-29 22:19:19 +01:00
2023-11-29 22:19:19 +01:00
2023-11-29 22:19:19 +01:00
2023-12-03 10:43:16 +01:00
2023-12-03 10:35:14 +01:00
2023-12-03 10:35:14 +01:00
2023-11-29 22:19:19 +01:00
2023-12-03 10:35:14 +01:00

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.

Description
No description provided
Readme 74 KiB
Languages
Python 100%