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

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.2
File Size Uploaded Provenance Actions
plain_pytest-0.13.2.tar.gz 7.5 kB Without provenance Details for plain_pytest-0.13.2.tar.gz

Built distribution (wheel)

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

Total release size: 18.2 kB

Release files / plain_pytest-0.13.2.tar.gz

Download URL plain_pytest-0.13.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3428f9b2acd73afc8c62c0faf0c3d5baa47199f3327723a0c91ac219de629d50
BLAKE2b-256 checksum
How to use checksums
203572cdb1a9f6f702e884fda49c62da5757b7f8040b5c138fd0fb25ee08fa4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"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.13.2-py3-none-any.whl

Download URL plain_pytest-0.13.2-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f1ff249d8a7c14fd78cc36e8933a7184e9800c871a28ab649e43329889f0b94
BLAKE2b-256 checksum
How to use checksums
e9ed401cc0daa3522d8073403717e047bd24209d6fccdbc0b0fa04e82bdc6742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"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.13.2

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