Skip to main content

This is a fork of garybernhardt/expecter that hides the internal stack trace for pytest.

Build Status
PyPI Version
PyPI Downloads

Overview

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

from expecter import expect


def describe_foobar():

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

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

and instead of getting output like this:

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

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

test_foobar.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = expect(5), other = 6

    def __eq__(self, other):
        msg = 'Expected %s but got %s' % (repr(other), repr(self._actual))
        if (isinstance(other, basestring) and
                isinstance(self._actual, basestring)):
            msg += normalized_diff(other, self._actual)
        elif len(repr(self._actual)) > 74:
            msg += normalized_diff(pprint.pformat(other),
                                   pprint.pformat(self._actual))
>       assert self._actual == other, msg
E       AssertionError: Expected 6 but got 5

env/lib/python3.5/site-packages/expecter.py:57: AssertionError
====================== 1 failed, 1 passed in 2.67 seconds ======================

getting output like this:

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

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

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

Installation

pip install pytest-expecter

Versioning

This plugin’s version number will follow expecter:

X.Y.Z.postN

where:

  • X.Y.Z is the version of expecter included in the plugin

  • N is incremented on each release of the plugin for that version

Metadata

Release files for pytest-expecter 0.2.2.post4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-expecter 0.2.2.post4
File Size Uploaded Provenance Actions
pytest-expecter-0.2.2.post4.tar.gz 4.5 kB Without provenance Details for pytest-expecter-0.2.2.post4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-expecter 0.2.2.post4
File Interpreter ABI Platform Actions
pytest_expecter-0.2.2.post4-py3-none-any.whl Python 3 none any Details for pytest_expecter-0.2.2.post4-py3-none-any.whl

Total release size: 11.2 kB

Release files / pytest-expecter-0.2.2.post4.tar.gz

Download URL pytest-expecter-0.2.2.post4.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
120339bd9b271f7950eca11f4ced573e0b864ab6ce184b1615e3777887e16d1a
BLAKE2b-256 checksum
How to use checksums
d95b1f2214bc4b204b03a34ac1848a7c23e5c23ad8bd699e3de57b9a686a9825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pytest_expecter-0.2.2.post4-py3-none-any.whl

Download URL pytest_expecter-0.2.2.post4-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d369ca23937714e801c33f74cd9267ead935425b445b38307ad86a0404f199fc
BLAKE2b-256 checksum
How to use checksums
4d45fe619187f37e77304e1d300cda9e8f93aaa7093155fe461d7343736c2464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pytest-expecter 0.2.2.post4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.2.post4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page