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 (unreleased)
- 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.3b4.tar.gz
(11.5 kB
view details)
Built Distribution
File details
Details for the file pytest-expecter-1.3b4.tar.gz
.
File metadata
- Download URL: pytest-expecter-1.3b4.tar.gz
- Upload date:
- Size: 11.5 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 | 7c791163c7dc547ddb0ecc1131b82fa2db57c73fe20cc3a61d7a8655057197fa |
|
MD5 | c60e725ca91719194a79e6d03d7e5787 |
|
BLAKE2b-256 | 61c9ab5d6881f0c33cb7d6f73367fd7812321ffd767ece3219e352bc21a457b5 |
File details
Details for the file pytest_expecter-1.3b4-py2-none-any.whl
.
File metadata
- Download URL: pytest_expecter-1.3b4-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 | 4d1bf8ec2ea12e790c027daa8375cd3abc422ef244afbc076558bde0d3e8f752 |
|
MD5 | 7295919abfed39248ff1395f8c36214a |
|
BLAKE2b-256 | 9b23fd35b633ba34421e3f808192d52484bc482ab19b125db5b49e786f398e2f |