proxymail-qa
Test-Postfächer für Tests zur Registrierung, Anmeldung und zum Zurücksetzen des Passworts in Python: Erstellen Sie eine Testadresse und warten Sie dann auf den Code oder den Link aus der E-Mail.
Downloads & Community-Verbreitung
Gesundheits- & Engineering-Analyse (5 Säulen)
1. Governance & Community50 / 200 ▾
2. PEP-Metadaten & Paketierung200 / 200 ▾
3. Sicherheit & Lieferkette100 / 200 ▾
4. Dokumentation, SEO & Ökosystem155 / 200 ▾
5. Engineering, CI & Qualität35 / 200 ▾
Offizielle Dokumentation & Nutzungsleitfaden — proxymail-qa
Vollständige Originaldokumentation anzeigen (Englisches README) ▾
Proxy Mail QA for Python
Test inboxes for sign-up, login and password-reset tests in Python, with pytest and Selenium or Playwright. Make a test address with a realistic test person, sign up with it in your app, then wait for the code or link from the email.
pip install proxymail-qa
It uses only the standard library and runs on Python 3.9 or later.
A sign-up test
Create an API key in app.proxymail.qa → Project settings → API keys, and set it as PROXYMAIL_QA_API_KEY where your tests run.
import re
from playwright.sync_api import Page, expect
from proxymail_qa import create_address, delete_address, now, wait_for_link
def test_sign_up_verifies_the_email(page: Page):
account = create_address()
page.goto("/signup")
page.get_by_label("Email").fill(account["address"])
page.get_by_label("Password").fill(account["password"])
submitted = now()
page.get_by_role("button", name="Sign up").click()
page.goto(wait_for_link(account["address"], since=submitted))
expect(page).to_have_url(re.compile("verified"))
delete_address(account["address"])
since makes the wait ignore anything sent before the form was submitted. wait_for_code does the same for a code. The guide covers form values, account pools, checks on an email, two-factor codes and run reports: proxymail.qa/docs/python.
Run reports in pytest
To have each call name its test, and failed tests and totals recorded in a run, import the hooks into conftest.py:
from proxymail_qa import pytest_runtest_setup, pytest_runtest_teardown, pytest_runtest_logreport, pytest_sessionfinish
Licence
MIT