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.3 (2018/08/10)
- Added
startswith
,endswith
,istartswith
, andiendswith
helpers. - Added support for Python 3.7.
1.2 (2018/03/17)
- Added
icontains
method to check for containment ignoring case. - Added
iexcludes
method to check for exclusion ignoring case.
1.1 (2018/02/21)
- Added
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
todict
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.3.tar.gz
(11.4 kB
view details)
Built Distribution
File details
Details for the file pytest-expecter-1.3.tar.gz
.
File metadata
- Download URL: pytest-expecter-1.3.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.3 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8e9ab98ddd576436b61a7ba61ea11cfa5a3fc6b00288ce9e91e9dd770daf19 |
|
MD5 | 15d3b56d671121ba425bf8ed2d9fdf82 |
|
BLAKE2b-256 | 46311536af290c8bcaba012bd4926ba08e2046a9c4615e398d8349d007939d4e |
File details
Details for the file pytest_expecter-1.3-py2-none-any.whl
.
File metadata
- Download URL: pytest_expecter-1.3-py2-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.3 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27c93dfe87e2f4d28c525031be68d3f89457e3315241d97ee15f7689544e0e37 |
|
MD5 | 12ccb19dc90c22312c119305d3257cd5 |
|
BLAKE2b-256 | 60f2065a17474ba96d3972677fd88c84fafb1e8c03759693d50f4fd637054923 |