ParamUnittest

0.2 BSD License    
  UNRATED

  176 downloads

Simple extension to have parametrized unit tests

description

download

specs

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

#parametrized test #unit tests #Python extension #Python #parametrized #unit #tests