pytest-plugins
An advanced pytest plugin designed for Python projects, offering robust features and utilities to enhance the testing workflow.
It includes improved conftest.py fixtures, automated test result reporting, detailed logging, and seamless integration with external tools for a streamlined and efficient testing experience.
🚀 Features
- ✅ better-report: Enhanced test result tracking and structured JSON reporting.
generate
execution_results.json,test_results.json, andtest_report.md undertests/results_output/directory.- flags:
--better-report: Enable the better report feature.--output-dir: Specify the output directory for the report files (default isroot_project/results_output/).--traceback: Include detailed traceback information in the report.--md-report: Generate a Markdown report of the test results.repo-name: Specify the git repository name for the report.--pr-number: Include a pull request number in the report for better traceability.--mr-number: Include a merge request number in the report for better traceability.--pipeline-number: Include a CI pipeline number in the report for better traceability.--commit: Include the commit hash in the report for better traceability.--add-parameters: Add the test parameters as fields to the test results.--pytest-command: Add the detailed information about the pytest command-line to the "execution_results.json" file--pytest-xfail-strict: Enable strict xfail handling, treating unexpected passes as failures, if set to True "execution status" will be "failed" when there is at least one xpass test--result-each-test: Print the pytest result for each test after its execution--log-collected-tests: Log all collected tests at the start of the test session
- flags:
- ✅ maxfail-streak: Stop test execution after a configurable number of consecutive failures.
- flags:
--maxfail-streak=N: Stop test execution afterNconsecutive failures.
- flags:
- ✅ fail2skip: Change failing tests to skipped, allowing for better test management and reporting.
- flags:
--fail2skip: Enable the fail2skip feature.@pytest.mark.fail2skip: Decorator to mark tests that should be skipped on failure.
- ✅ verbose-param-ids: Enhance test IDs with parameter names for better clarity in pytest reports.
- flags:
--verbose-param-ids: Include parameter names in pytest test IDs (e.g.,(param1: value1, param2: value2)instead of(param1-param2))
- ✅ require-tests: Fail the run if no tests were collected. Raises a
UsageError(exit code 4) when--require-testsis set and zero tests are found.- flags:
--require-tests: Enable the require-tests feature.
- flags:
📦 Installation
pip install pytest-plugins
🔧 Usage
Add the following to your pytest.ini file to enable the plugin features:
[pytest]
addopts =
--better-report
--output-dir=logs
--pr-number=123
; --mr-number=123
--fail2skip
--maxfail-streak=3
--add-parameters
--pytest-command
--verbose-param-ids
--md-report
--traceback
--require-tests
🤝 Contributing
If you have a helpful tool, pattern, or improvement to suggest:
Fork the repo
Create a new branch
Submit a pull request
I welcome additions that promote clean, productive, and maintainable development.
🙏 Thanks
Thanks for exploring this repository!
Happy coding!
Metadata
Release files for pytest-plugins 3.3.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 |
|---|---|---|---|---|
| pytest_plugins-3.3.0.tar.gz | 16.0 kB | Without provenance | Details for pytest_plugins-3.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_plugins-3.3.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_plugins-3.3.0-py3-none-any.whl |
Total release size: 34.8 kB
Release files / pytest_plugins-3.3.0.tar.gz
| Download URL | pytest_plugins-3.3.0.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f95f43f208101cc438d732ba5519729fb5ecf7ac6e607893fe8369d5e357470e
|
|
BLAKE2b-256 checksum How to use checksums |
7907c957f144b624ae10e708c3e01ec972b576e7267af85ed0b290345e05fbea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pytest_plugins-3.3.0-py3-none-any.whl
| Download URL | pytest_plugins-3.3.0-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5632acbeaeb68439c13356594769307f8c764c801aa985dccfe772fa71f4bf4
|
|
BLAKE2b-256 checksum How to use checksums |
ebc9bcacad41dba688f7e9e8b0039e1550b9c5937694a69c48f6ca3bfa3ae30b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pytest-plugins 3.3.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.