how to skip a unittest case in python 2.6

Viewed 2387

unittest.skip* decorators and methods as below (see here for more details) were added since python2.7 and i found they are quite useful.

unittest.skip(reason)
unittest.skipIf(condition, reason)
unittest.skipUnless(condition, reason)

However, my question is how we should do the similar if working with python2.6?

3 Answers

If you have the liberty of installing additional packages, you can use unittest2 which is Python 2.7 unittest backported to Python 2.3+. It does contain the skip decorators.

Related