Skip to main content

PyPI version Python Development Status Maintenance PyPI License


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, and test_report.md under tests/results_output/ directory.
    • flags:
      • --better-report: Enable the better report feature.
      • --output-dir: Specify the output directory for the report files (default is root_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

  • ✅ maxfail-streak: Stop test execution after a configurable number of consecutive failures.
    • flags:
      • --maxfail-streak=N: Stop test execution after N consecutive failures.

  • ✅ 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-tests is set and zero tests are found.
    • flags:
      • --require-tests: Enable the require-tests feature.

📦 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!

Release files for pytest-plugins 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-plugins 3.1.1
File Size Uploaded
pytest_plugins-3.1.1.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-plugins 3.1.1
File Interpreter ABI Platform
pytest_plugins-3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / pytest_plugins-3.1.1.tar.gz

Download URL pytest_plugins-3.1.1.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
23103706d22cdac8c8aa65c41db0db77f68c0514e725273f57a124b985f47f16
BLAKE2b-256 checksum
How to use checksums
e6bd6dc57a90799891354459d1890d18595f8ba910e9636c37e3676c0e80248b
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.1.1-py3-none-any.whl

Download URL pytest_plugins-3.1.1-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30356ad00d707500f4335e72fd12e5b3b13d7caa693f05349ad0237b73a8be6a
BLAKE2b-256 checksum
How to use checksums
1fe1ec3a54c6264c4da43c01dbd28ebbee63651d96974698de44d4987c2f396f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

3.3.0

2 release files

3.2.0

2 release files

This release

3.1.1 This release

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.8

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.1.28

2 release files

0.1.26

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

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