Skip to main content

pytest-describe-it

PyPI version PyPI - Python Version Build Status

Example

Some simple test:

import pytest


def add(x: int, y: int) -> int:
    return x + y


@pytest.mark.describe('add')
class TestAdd:

    @pytest.mark.parametrize(['x', 'y', 'expected'], [
        (1, 2, 3),
        (3, 4, 7),
        (5, 6, 10),
    ])
    @pytest.mark.it('returns {expected} for add({x}, {y})')
    def test_add(self, x, y, expected):
        assert add(x, y) == expected

Pytest output:

collected 3 items

test_add.py ..F                                                                 [100%]

====================================== FAILURES =======================================
________________ TestAdd.test_add[[ add  returns 10 for add(5, 6) ]] _________________

self = <test_add.TestAdd object at 0x10b740b70>, x = 5, y = 6, expected = 10

    @pytest.mark.parametrize(['x', 'y', 'expected'], [
        (1, 2, 3),
        (3, 4, 7),
        (5, 6, 10),
    ])
    @pytest.mark.it('returns {expected} for add({x}, {y})')
    def test_add(self, x, y, expected):
>       assert add(x, y) == expected
E       assert 11 == 10
E        +  where 11 = add(5, 6)

test_add.py:18: AssertionError
========================= 1 failed, 2 passed in 0.05 seconds ==========================

With pytest-sugar:

collecting ...
 test_add.py ✓✓                                                          67% ██████▋

―――――――――――――――― TestAdd.test_add[[ add  returns 10 for add(5, 6) ]] ―――――――――――――――――

self = <test_add.TestAdd object at 0x10e4e3550>, x = 5, y = 6, expected = 10

    @pytest.mark.parametrize(['x', 'y', 'expected'], [
        (1, 2, 3),
        (3, 4, 7),
        (5, 6, 10),
    ])
    @pytest.mark.it('returns {expected} for add({x}, {y})')
    def test_add(self, x, y, expected):
>       assert add(x, y) == expected
E       assert 11 == 10
E        +  where 11 = add(5, 6)

test_add.py:18: AssertionError

 test_add.py                                                           100% ██████████

Results (0.10s):
       2 passed
       1 failed
         - test_add.py:11 TestAdd.test_add[[ add  returns 10 for add(5, 6) ]]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-describe-it-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_describe_it-0.1.0-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-describe-it-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-describe-it-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

File hashes

Hashes for pytest-describe-it-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58789035ea73dce10253630c33de9b3afa2e3af320239bab137f2b7c9cb90a37
MD5 1e8634d2b93fa253b78d4967ec157fcf
BLAKE2b-256 3ed33568eb89155be2917d504cba84d2d7c68e691a9b525b15d8263d9f4f6273

See more details on using hashes here.

File details

Details for the file pytest_describe_it-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_describe_it-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

File hashes

Hashes for pytest_describe_it-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 102b14cdeea668eff089d706e03698b518d53174d2e1aed3c55c0e70a7ed7cf3
MD5 a51791f7fc8f87a26e7edd1c0f9340a8
BLAKE2b-256 e243a09d78e6eb9a1d469b7bcd40ca4cbecb9d1188ee7e66ca3edfb649a722bd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page