pytest-edit
A simple Pytest plugin for opening editor on the failed tests.
Installation & usage
Install with:
pip install pytest-edit
After installing the plugin, you need to rerun your tests before the plugin will be able to open them for edition.
Usage:
pytest --edit
This will open your $EDITOR at the first line of the last failed test. Not
all editors are capable of opening a file at a given line, and not all editors
that do are supported by pytest-edit. See below.
You can also specify the test using its index in the shortreport, for example:
pytest --edit=2 # will open the third failed test from the last run.
pytest --edit=-2 # will open the second-to-last failed test from the last run.
Setting the right editor & editor support
Use $EDITOR environment variable to set the editor that should be opened.
E.g. you can add export EDITOR=vim line to your .bashrc or .zshrc to set
the editor to vim.
If no editor is set, the defaults are vi for POSIX platforms and notepad
for Windows.
The plugin tries to be cleaver about the options given to the detected editor. If something is not working properly for you, don't hesitate to open an issue.
If an editor is not supported, the file of the specified test will be opened without specifying the line the editor should place the cursor at.
I have not tested 90% of the editor support - there are at least 3 platforms with tens of different editors. Issues & PRs welcome.
Metadata
Release files for pytest-edit 1.2
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 |
|---|---|---|---|---|
| pytest_edit-1.2.tar.gz | 4.5 kB | Without provenance | Details for pytest_edit-1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_edit-1.2-py3-none-any.whl | Python 3 | none | any | Details for pytest_edit-1.2-py3-none-any.whl |
Total release size: 9.5 kB
Release files / pytest_edit-1.2.tar.gz
| Download URL | pytest_edit-1.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
055837f7f7a9284eb7508657777b66ce187a9f2f102daf14512052a4bac25f4c
|
|
BLAKE2b-256 checksum How to use checksums |
9406d1c2dff17eea05bc50230ba30d703ec7e218d2f9437c958dd3e95533d5d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / pytest_edit-1.2-py3-none-any.whl
| Download URL | pytest_edit-1.2-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63762c64d63e8ba6c63f70dfde2a81d02f1f237034eddc18333f2673c841c1a1
|
|
BLAKE2b-256 checksum How to use checksums |
4d495bd65c3a24fbda8a67742a13f52fcd936176fe7c4bf4268a5d6a83b86973
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for pytest-edit 1.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.