ParamUnittest 0.2

Simple extension to have parametrized unit tests

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Enrico Franchi
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Programming \ Quality Assurance and Testing
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)

Last updated on September 23rd, 2012

requirements

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

Add your review!

SUBMIT