Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #3932 > unrolled thread

[Python-announce] unittest_expander 0.4.0 released

Started by"Jan Kaliszewski" <zuo@kaliszewski.net>
First post2023-03-16 14:59 +0000
Last post2023-03-16 14:59 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python.announce


Contents

  [Python-announce] unittest_expander 0.4.0 released "Jan Kaliszewski" <zuo@kaliszewski.net> - 2023-03-16 14:59 +0000

#3932 — [Python-announce] unittest_expander 0.4.0 released

From"Jan Kaliszewski" <zuo@kaliszewski.net>
Date2023-03-16 14:59 +0000
Subject[Python-announce] unittest_expander 0.4.0 released
Message-ID<167897879335.22048.1747213000048391311@mail.python.org>
I am pleased to announce the release of unittest_expander 0.4.0.

*unittest_expander* is a MIT-licensed Python library that provides
flexible and easy-to-use tools to parameterize your unit tests,
especially those based on `unittest.TestCase`.

The library is compatible with Python 3.11, 3.10, 3.9, 3.8, 3.7, 3.6 and
2.7, and does not depend on any external packages (uses only the Python
standard library).

Simple usage example:

```
import unittest
from unittest_expander import expand, foreach, param

@expand
class TestSomething(unittest.TestCase):
    @foreach(
        'Foo',
        ('Foo', 43),
        param('Foo', spam=44),
        param(foo='Bar', spam=45).label('with bar'),
        empty=param(foo='', spam=46),
    )
    def test_it(self, foo, spam=42, label=None):
        assert foo in ('Foo', 'Bar', '')
        assert 42 <= spam <= 46
        if label == 'with bar':
            assert foo == 'Bar' and spam == 45
        if label == 'empty':
            assert foo == '' and spam == 46
```

This is only a fraction of the possibilities the unittest_expander
library provides.

Homepage: https://github.com/zuo/unittest_expander
PyPI: https://pypi.org/project/unittest-expander/
Documentation: https://unittest-expander.readthedocs.io/en/stable/

Cheers,

Jan Kaliszewski (zuo) <zuo@kaliszewski.net>


<P><A HREF="https://unittest-expander.readthedocs.io/en/stable/">unittest_expander 0.4.0</A>
- a library that provides flexible and easy-to-use tools to parametrize Python unit tests.
(16-Mar-23)

[toc] | [standalone]


Back to top | Article view | comp.lang.python.announce


csiph-web