Skip to main content

pytest-spec

pytest plugin to display test execution output like a SPECIFICATION.

Available features

  • Format output to look like specification.

  • Group tests by classes.

  • Failed, passed and skipped are marked and colored.

  • Remove test_ and underscores for every test.

  • Method under test may be highlighted (method) like in example.

Output example

py.test --spec

test/test_example.py::TestWhenExamplePassed
    [PASS]  Execute returns positive return code

test/test_example.py::TestWhenExampleFailed
    [FAIL]  Execute returns negative return code

test/test_example.py::TestWhenExampleIsSkipped
    [SKIP]  Execute returns something

test/test_example.py::TestExamplesWhenMethodUnderTestIsHighlighted
    [FAIL]  The (execute_command) returns negative return code
    [PASS]  The (execute_command) returns positive return code
    [SKIP]  The (execute_command) returns something

Highlight method under test

Simple test definition is required (double ‘__’ characters before and after method) to put method under test between ‘<>’ characters e.g.

def test__execute_method__returns_something(self):

may be displayed as:

[PASS]  The (execute_command) returns something
[FAIL]  The (execute_command) returns something
[SKIP]  The (execute_command) returns something

This type of format provides clear information:

  • which method is under test

  • what kind of result should be expected

Continuous Integration

https://drone.io/github.com/pchomik/pytest-spec/status.png

Download

Latest version of plugin is available in drone.io project artifacts.

Install

pip install pytest-spec

Contribution

Please feel free to present your idea by code example (pull request) or reported issues.

Future plans

  • Tests with other pytest plugins to check possible side-effects.

  • Work to make output even better.

License

pytest-spec - pytest plugin to display test execution output like a SPECIFICATION.

Copyright (C) 2014 Pawel Chomicki

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Metadata

Release files for pytest-spec 1.0.0

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-spec 1.0.0
File Size Uploaded Provenance Actions
pytest-spec-1.0.0.tar.gz 4.7 kB Without provenance Details for pytest-spec-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-spec 1.0.0
File Interpreter ABI Platform Actions
pytest_spec-1.0.0-py3-none-any.whl Python 3 none any Details for pytest_spec-1.0.0-py3-none-any.whl

Total release size: 9.2 kB

Release files / pytest-spec-1.0.0.tar.gz

Download URL pytest-spec-1.0.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2e4084f8c2ebf448f491733d5b1874789c95068e19dd81049d06f370df611775
BLAKE2b-256 checksum
How to use checksums
dbb185b56cd59f691a27562968827abf9198eb6bbc0e4dff5f110250428ec88b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pytest_spec-1.0.0-py3-none-any.whl

Download URL pytest_spec-1.0.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0859b8fdf3ed069a2187cc3132be8fd11b0c97a1a3ac4a1c8b0959c8a3b04f2
BLAKE2b-256 checksum
How to use checksums
fd8b910ba294928560dd2401c113403e3647a6c00f5c7b61d0123294a7fdf5ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pytest-spec 1.0.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.

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