Metadata-Version: 2.1
Name: pytest-describe-it
Version: 0.1.0
Summary: plugin for rich text descriptions
Home-page: https://github.com/tkukushkin/pytest-describe-it
Author: Timofey Kukushkin
Author-email: tima@kukushkin.me
License: MIT
Project-URL: Source, https://github.com/tkukushkin/pytest-describe-it
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Description-Content-Type: text/markdown
Requires-Dist: pytest
Requires-Dist: typing ; python_version < "3"
Provides-Extra: test
Requires-Dist: pycodestyle ; extra == 'test'

# pytest-describe-it

[![PyPI version](https://badge.fury.io/py/pytest-describe-it.svg)](https://pypi.org/project/pytest-describe-it/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-describe-it.svg?color=green) [![Build Status](https://travis-ci.org/tkukushkin/pytest-describe-it.svg?branch=master)](https://travis-ci.org/tkukushkin/pytest-describe-it)

## Example

Some simple test:
```python
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:
```python
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:
```python
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) ]]
```


