Skip to main content

pytest-expecter

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

Build Status
PyPI Version

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.post5

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.post5
File Size Uploaded Provenance Actions
pytest-expecter-0.2.2.post5.tar.gz 4.6 kB Without provenance Details for pytest-expecter-0.2.2.post5.tar.gz

Built distribution (wheel)

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

Total release size: 11.5 kB

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

Download URL pytest-expecter-0.2.2.post5.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ccbd8e28adf7d5def8419233d7ea6726a549490bb3503fec7d4bdb8ff924c4cb
BLAKE2b-256 checksum
How to use checksums
4c95ffac3b5372c6c4db45209899c6656cfca23a1f05abe002aa44f1435d1a46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL pytest_expecter-0.2.2.post5-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cb071685e722087b071e92dbf35062140cf8b63875dc4c02b4d4e3d0e5bba81
BLAKE2b-256 checksum
How to use checksums
2183473b8f058d04dfa1df3aa6bfe846ef81611ee30145289970f9a2f0396c64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pytest-expecter 0.2.2.post5

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.post5 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