Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python.announce > #1355 > unrolled thread
| Started by | Jan Kaliszewski <zuo@kaliszewski.net> |
|---|---|
| First post | 2014-08-17 00:53 +0200 |
| Last post | 2014-08-17 00:53 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python.announce
unittest_expander 0.3.0 released Jan Kaliszewski <zuo@kaliszewski.net> - 2014-08-17 00:53 +0200
| From | Jan Kaliszewski <zuo@kaliszewski.net> |
|---|---|
| Date | 2014-08-17 00:53 +0200 |
| Subject | unittest_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)
Back to top | Article view | comp.lang.python.announce
csiph-web