[TIP] What version of ‘unittest2’ is needed for Python 3.4 features?

Ben Finney ben+python at benfinney.id.au
Tue Jul 26 18:31:04 PDT 2016


Howdy all,

What version of the unittest2 library do I need for the new features in
Python 3.4's unittest?

The unittest2 library [0] is a very useful back-port of Python 3's
unittest features, to work on older Python versions. By importing that
third-party library, you can use the features described for Python 3's
unittest in your Python 2 code.

There are some handy new features [1] in Python 3.4's unittest library.
(In particular I'm trying to use the “subtests” feature in a way that
will just keep working when we migrate to Python 3.)

To use those features in code written for Python 2 and Python 3, what
version of unittest2 do I need to install?


[0] https://pypi.python.org/pypi/unittest2/
[1] https://docs.python.org/3.4/whatsnew/3.4.html#unittest

-- 
 \          “I like to reminisce with people I don't know. Granted, it |
  `\                                     takes longer.” —Steven Wright |
_o__)                                                                  |
Ben Finney




More information about the testing-in-python mailing list