Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python.announce > #1355
| Date | 2014-08-17 00:53 +0200 |
|---|---|
| From | Jan Kaliszewski <zuo@kaliszewski.net> |
| Subject | unittest_expander 0.3.0 released |
| Newsgroups | comp.lang.python.announce |
| Message-ID | <mailman.13060.1408256442.18130.python-announce-list@python.org> (permalink) |
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)
Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread
unittest_expander 0.3.0 released Jan Kaliszewski <zuo@kaliszewski.net> - 2014-08-17 00:53 +0200
csiph-web