Better testing with expecter and pytest.
Project description
pytest-expecter
A pytest plugin for garybernhardt/expecter that hides the internal stacktrace.
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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for pytest_expecter-1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa455bbb79c10eac0864fc37fb28de2932e3af61da122e2732a0634fa0d8077c |
|
MD5 | 32dae2d353f9cd5aff6c1e8982a21b1e |
|
BLAKE2b-256 | fc55d5b94891919cf3d9108ce73192050e344f6a7b3fd132d057168dba3c9af4 |