Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
Low maintenance activity. Last release 6 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install pytest-spec
pytest-spec
Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
[Documentation]
Available features
- Format output to look like specification.
- Group tests by classes and files
- Failed, passed and skipped are marked and colored.
- Remove test_ and underscores for every test.
- It is possible to use docstring summary instead of test name.
- Supports function based, class based test.
- Supports describe like tests.
Output example

Configuration
spec_header_format
spec_header_format
You can configure the format of the test headers by specifying a format string in your ini-file:
; since pytest 4.6.x
[pytest]
spec_header_format = {module_path}:
; legacy pytest
[tool:pytest]
spec_header_format = {module_path}:
or in your file: