freebsd-ports/devel/py-unittest2/pkg-descr
Mark Felder 731b9eed8e devel/py-unittest2: Revive deleted port
This port is still of value. The built-in unittest in Python 2.7 is
missing features provided by unittest2 which backports from Python 3.x.

Example code which produces a failure with 2.7's built-in unittest:

import unittest2
import unittest

class ExampleUT(unittest.TestCase):

    def test_unittest(self):
        for i in [1, 2, 3]:
            with self.subTest(i=i):
                self.assertEqual(i, i)

class ExampleUT2(unittest2.TestCase):

    def test_unittest2(self):
        for i in [1, 2, 3]:
            with self.subTest(i=i):
                self.assertEqual(i, i)

if __name__ == '__main__':
    unittest2.main()
2016-12-22 23:05:08 +00:00

5 lines
182 B
Text

unittest2 is a backport of the new features added to the
unittest testing framework in Python 2.7. It is tested to
on Python 2.4 - 2.7.
WWW: https://pypi.python.org/pypi/unittest2/