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


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

unittest_expander 0.3.0 released

Started byJan Kaliszewski <zuo@kaliszewski.net>
First post2014-08-17 00:53 +0200
Last post2014-08-17 00:53 +0200
Articles 1 — 1 participant

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


Contents

  unittest_expander 0.3.0 released Jan Kaliszewski <zuo@kaliszewski.net> - 2014-08-17 00:53 +0200

#1355 — unittest_expander 0.3.0 released

FromJan Kaliszewski <zuo@kaliszewski.net>
Date2014-08-17 00:53 +0200
Subjectunittest_expander 0.3.0 released
Message-ID<mailman.13060.1408256442.18130.python-announce-list@python.org>
I am pleased to announce the release of unittest_expander 0.3.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 compatibile with Python 2.6, 2.7, 3.2, 3.3 and 3.4, 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.python.org/pypi/unittest_expander
Documentation: http://unittest-expander.readthedocs.org/en/latest/


Cheers,
Jan Kaliszewski (zuo)

[toc] | [standalone]


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


csiph-web