ParamUnittest

  176 downloads
0.2 BSD License    
  not rated
Simple extension to have parametrized unit tests

description

download

specifications

ParamUnittest is a Python tool designed to allow the creation of parametrized unit tests capable of working with the official unittest Python package.

Examples:

import unittest
import paramunittest

@paramunittest.parametrized(
 ('1', '2'),
 #(4, 3),
 ('2', '3'),
 (('4', ), {'b': '5'}),
 ((), {'a': 5, 'b': 6}),
 {'a': 5, 'b': 6},
)
class TestFoo(paramunittest.ParametrizedTestCase):
 def setParameters(self, a, b):
 self.a = a
 self.b = b

 def testLess(self):
 self.assertLess(self.a, self.b)

@paramunittest.parametrized(
 ('1', '2'),
 #(4, 3),
 ('2', '3'),
 (('4', ), {'b': '5'}),
 ((), {'a': 5, 'b': 6}),
 {'a': 5, 'b': 6},
)
class TestBar(unittest.TestCase):
 def setParameters(self, a, b):
 self.a = a
 self.b = b

 def testLess(self):
 self.assertLess(self.a, self.b)
READ MORE   
Last updated on September 23rd, 2012

0 User reviews so far.

SUBMIT