Skip to main content

Better testing with expecter and pytest.

Project description

pytest-expecter

A pytest plugin for garybernhardt/expecter that hides the internal stacktrace.

Build Status
PyPI Version

Overview

This lets you write tests (optionally using ropez/pytest-describe) like this:

def describe_foobar():

    def it_can_pass(expect):
        expect(2 + 3) == 5

    def it_can_fail(expect):
        expect(2 + 3) == 6

and get output like this:

=================================== FAILURES ===================================
_________________________ describe_foobar.it_can_fail __________________________

    def it_can_fail(expect):
>       expect(2 + 3) == 6
E       AssertionError: Expected 6 but got 5

test_foobar.py:7: AssertionError
====================== 1 failed, 1 passed in 2.67 seconds ======================

Installation

pip install pytest-expecter

Revision History

1.1 (2018/02/21)

  • Add expect fixture to use directly in tests.

1.0 (2017/12/03)

  • Initial stable release.

0.2.2.post7 (2017/12/02)

  • Added automatic conversion from OrderedDict to dict on Python 3.6 to create readable diffs.

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-expecter-1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

pytest_expecter-1.1-py2-none-any.whl (15.0 kB view details)

Uploaded Python 2

File details

Details for the file pytest-expecter-1.1.tar.gz.

File metadata

File hashes

Hashes for pytest-expecter-1.1.tar.gz
Algorithm Hash digest
SHA256 4472ea85240c5394c427a1ca1cedd6c7427d02b589845360744f04420cd21e94
MD5 4f206e2b5ceb431155a6b4ead5b6d523
BLAKE2b-256 dac5720e3970d655d16400f9a2db7e943976283936138390e7976ae61545c2e8

See more details on using hashes here.

File details

Details for the file pytest_expecter-1.1-py2-none-any.whl.

File metadata

File hashes

Hashes for pytest_expecter-1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 aa455bbb79c10eac0864fc37fb28de2932e3af61da122e2732a0634fa0d8077c
MD5 32dae2d353f9cd5aff6c1e8982a21b1e
BLAKE2b-256 fc55d5b94891919cf3d9108ce73192050e344f6a7b3fd132d057168dba3c9af4

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