Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_smtp_test_server-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

pytest_smtp_test_server-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pytest_smtp_test_server-0.1.1.tar.gz.

File metadata

  • Download URL: pytest_smtp_test_server-0.1.1.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

Hashes for pytest_smtp_test_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 839fb60ebde6f1adec2668cabc2e85c0624e8a857ebde2bdaad5d6234d897190
MD5 1f5088cc0e487d9a783358735d31af8e
BLAKE2b-256 2cc6b79c6229fcd823a3a2f0e150eb011ce73ff321840356088b409a48812d59

See more details on using hashes here.

File details

Details for the file pytest_smtp_test_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_smtp_test_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6065b184e182078f89c201aa30bd33d8c8abe5194f7c5ddfea92e525be5b566
MD5 6de0564b82be22ff8c8c42ea5bd3b755
BLAKE2b-256 1d1cb6934952fa8e9dc6e776fd4519923935badde4b9b816fc4511a403206a95

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page