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

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

Built distribution (wheel)

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

Total release size: 10.8 kB

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

Download URL pytest-expecter-0.2.2.post3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9f24b5a52a529170956bf578003d5eba05a78c611198b4bd53ae548c40c7371d
BLAKE2b-256 checksum
How to use checksums
982b35627c6e2298cfe7fa8f5986da994cea4902fdc86570a0d3db976a72eb75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

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

Security for pytest-expecter 0.2.2.post3

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