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.14.0

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.14.0
File Size Uploaded Provenance Actions
plain_pytest-0.14.0.tar.gz 7.9 kB Without provenance Details for plain_pytest-0.14.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.2 kB

Release files / plain_pytest-0.14.0.tar.gz

Download URL plain_pytest-0.14.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dbaf3e0bb223e7c7d5db489398d09484ffc1a90d0634be3bf751e5ec2ca86abb
BLAKE2b-256 checksum
How to use checksums
74a4e8e5231114de5fbdcbe83343775529c4c1d5e9aebf74adbf57dee14f5ab8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL plain_pytest-0.14.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bdf0801924b779c161844f92e448086253af1887c98dea165d7b13a695d5e066
BLAKE2b-256 checksum
How to use checksums
db256b48e8ad160ea29e3db1d6e271676767470f85ab9d82cf83970ceecbe674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for plain.pytest 0.14.0

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.14.0 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