smtpdfix/fixture.py
def smtpd(request):
    """A small SMTP server for use when testing applications that send email
    messages. To access the messages call `smtpd.messages` which returns a copy
    of the list of messages sent to the server.

    Example:
        def test_mail(smtpd):
            from smtplib import SMTP
            with SMTP(smtpd.hostname, smtpd.port) as client:
                code, resp = client.noop()
                assert code == 250
    """
    config = Config()

    fixture = AuthController(
        hostname=config.SMTPD_HOST,
        port=int(config.SMTPD_PORT),
        config=config,
        authenticator=_Authenticator(config)
    )
    fixture.start()
    yield fixture
    fixture.stop()
A small SMTP server for use when testing applications that send email
    messages. To access the messages call `smtpd.messages` which returns a copy
    of the list of messages sent to the server.

    Example:
        def test_mail(smtpd):
            from smtplib import SMTP
            with SMTP(smtpd.hostname, smtpd.port) as client:
                code, resp = client.noop()
                assert code == 250
    
A small SMTP server for use when testing applications that send email
messages. To access the messages call `smtpd.messages` which returns a copy
of the list of messages sent to the server.
A small SMTP server for use when testing applications that send email messages . To access the messages call ` smtpd . messages ` which returns a copy of the list of messages sent to the server .
def smtpd(request):
    config = Config()
    fixture = AuthController(
        hostname=config.SMTPD_HOST,
        port=int(config.SMTPD_PORT),
        config=config,
        authenticator=_Authenticator(config)
    )
    fixture.start()
    yield fixture
    fixture.stop()
def smtpd ( request ) : config = Config ( ) fixture = AuthController ( hostname = config . SMTPD_HOST , port = int ( config . SMTPD_PORT ) , config = config , authenticator = _Authenticator ( config ) ) fixture . start ( ) yield fixture fixture . stop ( )
A small SMTP server for use when testing applications that send email
messages.
A small SMTP server for use when testing applications that send email messages .
"""A small SMTP server for use when testing applications that send email
    messages. To access the messages call `smtpd.messages` which returns a copy
    of the list of messages sent to the server.

    Example:
        def test_mail(smtpd):
            from smtplib import SMTP
            with SMTP(smtpd.hostname, smtpd.port) as client:
                code, resp = client.noop()
                assert code == 250
    """
request
examples
def test_mail(smtpd):
from smtplib import SMTP
with SMTP(smtpd.hostname, smtpd.port) as client:
code, resp = client.noop()
assert code == 250
def test_mail ( smtpd ) : from smtplib import SMTP with SMTP ( smtpd . hostname smtpd . port ) as client : code resp = client . noop () assert code == 250