Skip to main content

plain.pytest

Test with pytest.

Overview

Use the plain test command to run tests with pytest and automatically load a .env.test (if available).

def test_example(settings):
    settings.DEBUG = True
    assert settings.DEBUG is True

Fixtures

settings

Use the settings fixture to access and modify settings during tests. Any changes made to settings are automatically restored after the test completes.

def test_example(settings):
    settings.DEBUG = True
    assert settings.DEBUG is True

testbrowser

A lightweight wrapper around Playwright that starts a plain server side-process to point the browser at. The testbrowser fixture provides access to a TestBrowser instance.

Note that playwright and pytest-playwright are not dependencies of this package but are required if you want to use this fixture.

def test_example(testbrowser):
    page = testbrowser.new_page()
    page.goto('/')
    assert page.title() == 'Home Page'

The testbrowser includes useful methods:

If plain.models is installed, then the testbrowser will also load the isolated_db fixture and pass a DATABASE_URL to the plain server process.

Installation

Install the plain.pytest package from PyPI:

uv add plain.pytest --dev

Metadata

Release files for plain.pytest 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plain.pytest 0.13.1
File Size Uploaded Provenance Actions
plain_pytest-0.13.1.tar.gz 7.5 kB Without provenance Details for plain_pytest-0.13.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plain.pytest 0.13.1
File Interpreter ABI Platform Actions
plain_pytest-0.13.1-py3-none-any.whl Python 3 none any Details for plain_pytest-0.13.1-py3-none-any.whl

Total release size: 18.2 kB

Release files / plain_pytest-0.13.1.tar.gz

Download URL plain_pytest-0.13.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
341819d23abc0f2120625f86befbd4c3f63b878d8699297e95f636d0d8f2650a
BLAKE2b-256 checksum
How to use checksums
ad9fee1c4b6357044b49279c61f17e5c945147dec11038acfe9c79caf60f1a90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.7

Release files / plain_pytest-0.13.1-py3-none-any.whl

Download URL plain_pytest-0.13.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d64eb11a7758dec84469fa79880a3a48a02b0a7926f5e3a067b55624982afff9
BLAKE2b-256 checksum
How to use checksums
aa7dfa12a0cc3e5782a57d11b346a4b2b7e3a1f8322d6b3001e94c1dd01120e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.7

Security for plain.pytest 0.13.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.13.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page