Skip to main content

A plugin to use approvaltests with pytest

Project description

PyPI version Python versions See Build Status on Travis CI See Build Status on AppVeyor

A plugin to use approvaltests with pytest


This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.

Features

Configure approvaltests for use with pytest.
  • indicate which of the reporters to use on test failure

  • define your own diff reporter to use on test failure

Requirements

approvaltests

Installation

You can install “pytest-approvaltests” via pip from PyPI:

$ pip install pytest-approvaltests

Usage

See also the documentation for approval tests

When your approval tests fail and you are working interactively, you might like it to open another diff tool than when you are on a CI server for example.

This plugin allows you to configure pytest with which diff tool to use when tests fail.

To set the default reporter to ‘PythonNative’, suitable for use on the command line:

pytest –approvaltests-use-reporter=’PythonNative’

To define your own diff reporter, perhaps a program with a rich GUI installed only on your developer workstation:

pytest –approvaltests-add-reporter=”diff_program”

The value for ‘approvaltests-add-reporter’ should be an executable program that can diff two files received as arguments on the command line like this:

diff_program filepath1 filepath2

if it takes additional arguments, add them with ‘approvaltests-add-reporter-args’:

pytest –approvaltests-add-reporter=”diff_program” –approvaltests-add-reporter-args=”arg1,arg2”

They will be inserted like this:

diff_program arg1 arg2 filepath1 filepath2

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, “pytest-approvaltests” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

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-approvaltests-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distributions

pytest_approvaltests-0.1.0-py3.7.egg (4.7 kB view details)

Uploaded Source

pytest_approvaltests-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest-approvaltests-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-approvaltests-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pytest-approvaltests-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e3dabe69450dad5806b92c24d2502497941f28421dd538631212ca8c2e04bba
MD5 5b4e98ef6b5ecbfe5ca06ff23f0b7aa7
BLAKE2b-256 4cf502923971a8a930cbe15ee44b5a919d14d9193c63fbd41d54146949cc5ed8

See more details on using hashes here.

File details

Details for the file pytest_approvaltests-0.1.0-py3.7.egg.

File metadata

  • Download URL: pytest_approvaltests-0.1.0-py3.7.egg
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pytest_approvaltests-0.1.0-py3.7.egg
Algorithm Hash digest
SHA256 de1d3b50d03b3463af3ec43ddfb49e047358c823686a336d551b96625a297722
MD5 9d8481cdc63a6adae93928f93508da7f
BLAKE2b-256 f9f4a947667ca9065e054e23587a2bef7f05bd49c56e7c826016ed65a01a5284

See more details on using hashes here.

File details

Details for the file pytest_approvaltests-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_approvaltests-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pytest_approvaltests-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 271c0e968c7078e043f9d7528aa0ea4e82667cb81e1db77796e1bc6793fd8199
MD5 86a0fd3a33e378f73d5934a041dd3669
BLAKE2b-256 5fccd077616a1427b0498929f19a2e885e86df213e5d3dba259db8557569b139

See more details on using hashes here.

Supported by

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