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:
force_login(user)- Log in a user without going through the login flowlogout()- Clear all cookies to log outdiscover_urls(urls)- Recursively discover all URLs starting from the given URLs
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plain_pytest-0.13.0.tar.gz | 7.4 kB | Without provenance | Details for plain_pytest-0.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plain_pytest-0.13.0-py3-none-any.whl | Python 3 | none | any | Details for plain_pytest-0.13.0-py3-none-any.whl |
Total release size: 17.9 kB
Release files / plain_pytest-0.13.0.tar.gz
| Download URL | plain_pytest-0.13.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa69369c0a8d2dbd14cbb8c10a396b068b4a6fda15f467d85a8e907e42533b81
|
|
BLAKE2b-256 checksum How to use checksums |
180864e321034ffe69a6013829f656a27dcd7c1f1d7ff7947ab0c8cebdc9589d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.3
|
Release files / plain_pytest-0.13.0-py3-none-any.whl
| Download URL | plain_pytest-0.13.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26a0f3e42d5b7482b729ea47f5e5fb39dfa35c639729fe55455ab1bfb35440b2
|
|
BLAKE2b-256 checksum How to use checksums |
1ac8b1f02560cc9d7d51716a47abf88473143ffd8e0537a07afdfc9a382bd4fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.3
|
Security for plain.pytest 0.13.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.