Socket
Socket
Sign inDemoInstall

pytest-smtp-test-server

Package Overview
Dependencies
2
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pytest-smtp-test-server

pytest plugin for using `smtp-test-server` as a fixture


Maintainers
1

Readme

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 namepytest fixture scope
smtp_mockfunction
class_smtp_mockclass
module_smtp_mockmodule
package_smtp_mockpackage
session_smtp_mocksession

If you require more control over hosts and ports, consider using smtp-test-server directly.

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc