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 details)
Built Distribution
File details
Details for the file pytest-expecter-1.1.tar.gz
.
File metadata
- Download URL: pytest-expecter-1.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4472ea85240c5394c427a1ca1cedd6c7427d02b589845360744f04420cd21e94 |
|
MD5 | 4f206e2b5ceb431155a6b4ead5b6d523 |
|
BLAKE2b-256 | dac5720e3970d655d16400f9a2db7e943976283936138390e7976ae61545c2e8 |
File details
Details for the file pytest_expecter-1.1-py2-none-any.whl
.
File metadata
- Download URL: pytest_expecter-1.1-py2-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa455bbb79c10eac0864fc37fb28de2932e3af61da122e2732a0634fa0d8077c |
|
MD5 | 32dae2d353f9cd5aff6c1e8982a21b1e |
|
BLAKE2b-256 | fc55d5b94891919cf3d9108ce73192050e344f6a7b3fd132d057168dba3c9af4 |