Skip to main content

pytest plugin to display test execution output like a SPECIFICATION

Project description

pytest-spec

pytest plugin to display test execution output like a SPECIFICATION.

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.

  • Supports function based, class based test.

  • Supports describe like tests.

Output example

https://github.com/pchomik/pytest-spec/raw/master/docs/output.png

Configuration

spec_header_format

You can configure the format of the test headers by specifying a format string in your ini-file:

[pytest]
spec_header_format = {module_path}:

In addition to the {path} and {class_name} replacement fields, there is also {test_case} that holds a more human readable name.

spec_test_format

You can configure the format of the test results by specifying a format string in your ini-file:

[pytest]
spec_test_format = {result} {name}

spec_success_indicator

You can configure the indicator displayed when test passed.

[pytest]
spec_success_indicator = ✓

spec_failure_indicator

You can configure the indicator displated when test failed.

[pytest]
spec_failure_indicator = ✗

spec_skipped_indicator

You can configure the indicator displated when test is skipped.

[pytest]
spec_skipped_indicator = ?

spec_indent

[pytest]
spec_indent = "   "

Continuous Integration

https://github.com/pchomik/pytest-spec/workflows/test/badge.svg

Download

All versions of library are available on official pypi server.

Install

pip install pytest-spec

Contribution

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

Contributors

  • @0x64746b

  • @lucasmarshall

  • @amcgregor

  • @jhermann

  • @frenzymadness

  • @chrischambers

  • @maxalbert

  • @jayvdb

License

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

Copyright (C) 2014-2019 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-spec-3.0.5.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

pytest_spec-3.0.5-py2.py3-none-any.whl (13.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-spec-3.0.5.tar.gz.

File metadata

  • Download URL: pytest-spec-3.0.5.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for pytest-spec-3.0.5.tar.gz
Algorithm Hash digest
SHA256 7f2d6fa20bfb333fec6639f9c53bc399dfc94a4458fbb3b837faf46bc5171e19
MD5 07f0d0a7073b94d6cc9ccae3aa42d590
BLAKE2b-256 c796919fa0e725155e7d538e2f872b1869bbdaf867dad782a5f370a13e41e93a

See more details on using hashes here.

File details

Details for the file pytest_spec-3.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_spec-3.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for pytest_spec-3.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b74fd215b1ce791873f217078a2c261760193c0adc9bb7a5d7ad6846b7ba4d41
MD5 3b9e7a809224ba9789f218af4fb7d1e5
BLAKE2b-256 3ce0d4da258768ba041be00194986ba5fa7dc5db3a450e453de96eeb7368796e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page