unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7,
3.2, 3.3, 3.4 and pypy.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
unittest2 is maintained in a mercurial repository. The issue tracker is on
google code:
* `unittest2 hg <http://hg.python.org/unittest2>`_
* `unittest2 issue tracker
<http://code.google.com/p/unittest-ext/issues/list>`_
* `Article / Docs: New features in unittest
<http://www.voidspace.org.uk/python/articles/unittest2.shtml>`_
Thanks to Mark Roddy, there is a distribution of unittest2 0.5.1 for Python 2.3.
This is maintained as a separate branch and is a separate download.
To avoid problems with ``pip`` installing the wrong distribution, the Python 2.3
version of unittest2 can't be hosted on PyPI:
* `Download unittest2 0.5.1 for Python 2.3 <http://voidspace.org.uk/downloads/unittest2-0.5.1-python2.3.zip>`_
There was a separate version of unittest2 for Python 3. This is no longer
needed, but still exists on PyPI. This had the project name "unittest2py3k" but
uses the same package name ("unittest2"):
* `unittest2 for Python 3 <http://pypi.python.org/pypi/unittest2py3k>`_
Classes in unittest2 derive from the appropriate classes in unittest, so it
should be possible to use the unittest2 test running infrastructure without
having to switch all your tests to using unittest2 immediately. Similarly
you can use the new assert methods on ``unittest2.TestCase`` with the standard
unittest test running infrastructure. Not all of the new features in unittest2
will work with the standard unittest test loaders, runners result objects
however.
In general for documentation on unittest2 see the current latest documented of
CPython:
* `CPython unittest documentation <https://docs.python.org/dev/library/unittest.html>`_
New features include:
* ``addCleanups`` - better resource management
* *many* new assert methods including better defaults for comparing lists,
sets, dicts unicode strings etc and the ability to specify new default methods
for comparing specific types
* ``assertRaises`` as context manager, with access to the exception afterwards
* test discovery and new command line options (including failfast and better
handling of ctrl-C during test runs)
* class and module level fixtures: ``setUpClass``, ``tearDownClass``,
``setUpModule``, ``tearDownModule``
* test skipping and expected failures
* new ``delta`` keyword argument to ``assertAlmostEqual`` for more useful
comparison and for comparing non-numeric objects (like datetimes)
* ``load_tests`` protocol for loading tests from modules or packages
* ``startTestRun`` and ``stopTestRun`` methods on TestResult
* various other API improvements and fixes
.. note:: Command line usage
In Python 2.7 you invoke the unittest command line features (including test
discover) with ``python -m unittest <args>``. As unittest is a package, and
the ability to invoke packages with ``python -m ...`` is new in Python 2.7,
we can't do this for unittest2.
Instead unittest2 comes with a script ``unit2``.
`Command line usage
<http://docs.python.org/dev/library/unittest.html#command-line-interface>`_::
unit2 discover
unit2 -v test_module
There is also a copy of this script called ``unit2.py``, useful for Windows
which uses file-extensions rather than shebang lines to determine what
program to execute files with. Both of these scripts are installed by
distutils.
Until I write proper documentation, the best information on all the new features
is the development version of the Python documentation for Python 2.7:
* http://docs.python.org/dev/library/unittest.html
Look for notes about features added or changed in Python 2.7.
.. note::
unittest2 is already in use for development of `distutils2
<http://hg.python.org/distutils2>`_.
Version 0.5.1 of unittest2 has feature parity with unittest_ in Python 2.7
final. If you want to ensure that your tests run identically under unittest2
and unittest in Python 2.7 you should use unittest2 0.5.1.
Later versions of unittest2 include changes in unittest made in Python 3.2
and onwards after the release of Python 2.7.
.. _unittest: http://docs.python.org/release/2.7/library/unittest.html
Differences
===========
Differences between unittest2 and unittest in Python 2.7:
``assertItemsEqual`` does not silence Py3k warnings as this uses
``warnings.catch_warnings()`` which is new in Python 2.6 (and is used as a
context manager which would be a pain to make work with Python 2.4).
``TestCase.longMessage`` defaults to True because it is better. It defaults to
False in Python 2.7 for backwards compatibility reasons.
``python -m package`` doesn't work in versions of Python before Python 2.7. The
command line features of unittest2 are provided by a ``unit2`` (and
``unit2.py``) script instead.
unittest2 includes a very basic setuptools compatible test collector. Specify
``test_suite = 'unittest2.collector'`` in your setup.py. This starts test
discovery with the default parameters from the directory containing setup.py, so
it is perhaps most useful as an example (see unittest2/collector.py).
In unittest2 TextTestResult.stopTestRun is responsible for calling printErrors.
This is desirable behaviour but in Python 3.1 TestResult.stopTestRun was
documented as being empty and subclasses shouldn't need to call it. This would
make the change backwards incompatible and needs thinking about.
Issues
======
A ``TestResult`` object with unexpected successes returns True
for ``result.wasSuccessful()``. Difficult to know if this is the correct
behaviour or not.
If a dotted path name is used for test discovery then a globally installed
module/package will still be used in preference of one in the current
directory. When doing discovery from a dotted path name we could check for this
specific case.
The ``removeHandler`` decorator could also be a context manager.
`Issue 8313: <http://bugs.python.org/issue8313>`_, \<unprintable AssertionError object\>
message in unittest tracebacks, is hard to fix in versions of Python before 2.7.
The fix in Python 2.7 relies on changes to both the traceback module and
traceback objects. As the issue is rare I am leaving it unfixed in unittest2.
There are several places in unittest2 (and unittest) that call ``str(...)`` on
exceptions to get the exception message. This can fail if the exception was
created with non-ascii unicode. This is rare and I won't address it unless it is
actually reported as a problem for someone.
A comparison of text or long sequences (using ``assertSequenceEqual`` or
``assertMultiLineEqual`` etc) can take a *long* time to generate diffs for
failure messages. These methods use ``prettyprint`` and ``difflib``.
``pip install -e .`` on Python3.2 in the unittest2 source will fail unless
setuptools > 0.6.24 is already installed. This is a combination of needing a
newer setuptools (to avoid the use of execfile) and setup_requires falling back
to easy_install that doesn't know how to upgrade setuptools just-in-time that
prevents it being fixed in unittest2.
CHANGELOG
=========
2015-06-20 - 1.1.0
------------------
- Issue #15836: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() assertments now check the type of the first argument
to prevent possible user error. Based on patch by Daniel Wagner-Hall.
- Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks now emits a deprecation warning when callable is
None or keyword arguments except msg is passed in the context manager mode.
- Issue #22903: The fake test case created by unittest.loader when it fails
importing a test module is now picklable.
2015-03-12 - 1.0.1
------------------
- Unittest2 issue #94: Need at least 1.4 of six.
2015-03-06 - 1.0.0
------------------
- Issue #22936: Permit showing local variables in tracebacks.
2014/11/05 - 0.8
----------------
- Issue #22457: Honour load_tests in the start_dir of discovery.
- Issue #22894: TestCase.subTest() would cause the test suite to be stopped
when in failfast mode, even in the absence of failures.
2014/10/31 - 0.7.1
------------------
Fix for 0.7.0 being broken. Also switches from both manual and entrypoint
scripts to just entrypoint scripts to reduce the possibility of similar
oversights in future.
2014/10/31 - 0.7.0
------------------
This release contains backports from cPython 3.5 of all (I think) commits since
2010, as of today.
2014/10/28 - 0.6.0
------------------
Many thanks to Mark Roddy and Ezio Melotti who contributed substantially to
this release.
* Changed supported Python versions to start at 2.6, and include all released 3.x
and pypy. (Robert Collins)
* Invoking `unit2` without args starts test discovery
* Added `TestCase.assertWarns` and `TestCase.assertWarnsRegexp` context managers
* Fix Python issue 9926. TestSuite subclasses that override __call__ are called
correctly.
* Removed unused `maxDiff` parameter from `TestCase.assertSequenceEqual`.
* DeprecationWarning for unsupported result objects (missing addSkip method)
became RuntimeWarning.
* Addition of `TestCase.assertWarns` as a context manager.
2010/07/12 - 0.5.1
------------------
Reverted script names created by setuptools back to "unit2" instead of
"unit2.py". (Not necessary as setuptools creates stub .exes for console scripts
anyway.)
2010/07/11 - 0.5.0
------------------
Addition of a setuptools compatible test collector (very basic). Specify
``test_suite = 'unittest2.collector'`` in your setup.py.
``TestSuite.debug()`` and ``TestCase.debug()`` now execute cleanup functions
and class and module level setups and teardowns.
No longer monkey-patch os.path.relpath for Python 2.4 / 2.5 so that projects
don't accidentally depend on our patching. Contributed by Konrad Delong.
Added a Python version specific unit2 entrypoint. This will, for example,
create a ``unit2-2.6`` script if unittest2 is installed with Python 2.6.
(Requires setuptools or distribute.)
Python 2.3 compatibility (in the python2.3 branch of the repository),
contributed by Mark Roddy.
setuptools console script entry points are created as '.py' scripts on Windows.
Feature parity with the Python 2.7 final release.
2010/06/06 - 0.4.2
------------------
Improved help message for ``unit2 discover -h``.
SkipTest in unittest.TestCase.setUpClass or setUpModule is now reported as a
skip rather than an error.
Excessively large diffs due to ``TestCase.assertSequenceEqual`` are no
longer included in failure reports. (Controlled by ``TestCase.maxDiff``.)
Matching files during test discovery is done in ``TestLoader._match_path``. This
method can be overriden in subclasses to, for example, match on the full file
path or use regular expressions for matching.
Addition of a setuptools compatible entrypoint for the unit2 test runner script.
Contributed by Chris Withers.
Tests fixed to be compatible with Python 2.7, where deprecation warnings are
silenced by default.
Feature parity with unittest in Python 2.7 RC 1.
2010/05/09 - 0.4.1
------------------
If test discovery imports a module from the wrong location (usually because the
module is globally installed and the user is expecting to run tests against a
development version in a different location) then discovery halts with an
``ImportError`` and the problem is reported.
Added docstrings to ``assertRegexpMatches`` and ``assertNotRegexpMatches``.
Putting functions in test suites no longer crashes.
Feature parity with unittest in Python 2.7 Beta 2.
2010/04/08 - 0.4.0
------------------
Addition of ``removeHandler`` for removing the control-C handler.
``delta`` keyword argument for ``assertAlmostEqual`` and
``assertNotAlmostEqual``.
Addition of -b command line option (and ``TestResult.buffer``) for buffering
stdout / stderr during test runs.
Addition of ``TestCase.assertNotRegexpMatches``.
Allow test discovery using dotted module names instead of a path.
All imports requiring the signal module are now optional, for compatiblity
with IronPython (or other platforms without this module).
Tests fixed to be compatible with nosetest.
2010/03/26 - 0.3.0
------------------
``assertSameElements`` removed and ``assertItemsEqual`` added; assert that
sequences contain the same elements.
Addition of -f/--failfast command line option, stopping test run on first
failure or error.
Addition of -c/--catch command line option for better control-C handling during
test runs.
Added ``BaseTestSuite``, for use by frameworks that don't want to support shared
class and module fixtures.
Skipped test methods no longer have ``setUp`` and ``tearDown`` called around
them.
Faulty ``load_tests`` functions no longer halt test discovery.
Using non-strings for failure messages now works.
Potential for ``UnicodeDecodeError`` whilst creating failure messages fixed.
Split out monolithic test module into a package.
BUGFIX: Correct usage message now shown for unit2 scripts.
BUGFIX: ``__unittest`` in module globals trims frames from that module in
reported stacktraces.
2010/03/06 - 0.2.0
------------------
The ``TextTestRunner`` is now compatible with old result objects and standard
(non-TextTestResult) ``TestResult`` objects.
``setUpClass`` / ``tearDownClass`` / ``setUpModule`` / ``tearDownModule`` added.
2010/02/22 - 0.1.6
------------------
Fix for compatibility with old ``TestResult`` objects. New tests can now be run
with nosetests (with a DeprecationWarning for ``TestResult`` objects without
methods to support skipping etc).
0.1
---
Initial release.
TODO
====
* Document ``SkipTest``, ``BaseTestSuite```
Release process
===============
1. Make sure there is an entry in the Changelog in this document.
1. Update __version__ in unittest2/__init__.py
1. Commit.
1. Create a tag for the version (e.g. ``hg tag 0.6.0``)
1. Push so there is no outstanding patches and no room for races.
1. Run ``make release`` to build an sdist and wheel and upload to pypi.
Raw data
{
"_id": null,
"home_page": "http://pypi.python.org/pypi/unittest2",
"name": "unittest2",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "unittest,testing,tests",
"author": "Robert Collins",
"author_email": "rbtcollins@hp.com",
"download_url": "https://files.pythonhosted.org/packages/7f/c4/2b0e2d185d9d60772c10350d9853646832609d2f299a8300ab730f199db4/unittest2-1.1.0.tar.gz",
"platform": "UNKNOWN",
"description": "unittest2 is a backport of the new features added to the unittest testing\nframework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7,\n3.2, 3.3, 3.4 and pypy.\n\nTo use unittest2 instead of unittest simply replace ``import unittest`` with\n``import unittest2``.\n\nunittest2 is maintained in a mercurial repository. The issue tracker is on\ngoogle code:\n\n* `unittest2 hg <http://hg.python.org/unittest2>`_\n* `unittest2 issue tracker\n <http://code.google.com/p/unittest-ext/issues/list>`_\n* `Article / Docs: New features in unittest\n <http://www.voidspace.org.uk/python/articles/unittest2.shtml>`_\n\nThanks to Mark Roddy, there is a distribution of unittest2 0.5.1 for Python 2.3.\nThis is maintained as a separate branch and is a separate download.\n\nTo avoid problems with ``pip`` installing the wrong distribution, the Python 2.3\nversion of unittest2 can't be hosted on PyPI:\n\n* `Download unittest2 0.5.1 for Python 2.3 <http://voidspace.org.uk/downloads/unittest2-0.5.1-python2.3.zip>`_\n\nThere was a separate version of unittest2 for Python 3. This is no longer\nneeded, but still exists on PyPI. This had the project name \"unittest2py3k\" but\nuses the same package name (\"unittest2\"):\n\n* `unittest2 for Python 3 <http://pypi.python.org/pypi/unittest2py3k>`_\n\nClasses in unittest2 derive from the appropriate classes in unittest, so it\nshould be possible to use the unittest2 test running infrastructure without\nhaving to switch all your tests to using unittest2 immediately. Similarly\nyou can use the new assert methods on ``unittest2.TestCase`` with the standard\nunittest test running infrastructure. Not all of the new features in unittest2\nwill work with the standard unittest test loaders, runners result objects\nhowever.\n\nIn general for documentation on unittest2 see the current latest documented of\nCPython:\n\n* `CPython unittest documentation <https://docs.python.org/dev/library/unittest.html>`_\n\nNew features include:\n\n* ``addCleanups`` - better resource management\n* *many* new assert methods including better defaults for comparing lists,\n sets, dicts unicode strings etc and the ability to specify new default methods\n for comparing specific types\n* ``assertRaises`` as context manager, with access to the exception afterwards\n* test discovery and new command line options (including failfast and better\n handling of ctrl-C during test runs)\n* class and module level fixtures: ``setUpClass``, ``tearDownClass``,\n ``setUpModule``, ``tearDownModule``\n* test skipping and expected failures\n* new ``delta`` keyword argument to ``assertAlmostEqual`` for more useful\n comparison and for comparing non-numeric objects (like datetimes)\n* ``load_tests`` protocol for loading tests from modules or packages\n* ``startTestRun`` and ``stopTestRun`` methods on TestResult\n* various other API improvements and fixes\n\n.. note:: Command line usage\n\n In Python 2.7 you invoke the unittest command line features (including test\n discover) with ``python -m unittest <args>``. As unittest is a package, and\n the ability to invoke packages with ``python -m ...`` is new in Python 2.7,\n we can't do this for unittest2.\n\n Instead unittest2 comes with a script ``unit2``.\n `Command line usage\n <http://docs.python.org/dev/library/unittest.html#command-line-interface>`_::\n\n unit2 discover\n unit2 -v test_module\n\n There is also a copy of this script called ``unit2.py``, useful for Windows\n which uses file-extensions rather than shebang lines to determine what\n program to execute files with. Both of these scripts are installed by\n distutils.\n\nUntil I write proper documentation, the best information on all the new features\nis the development version of the Python documentation for Python 2.7:\n\n* http://docs.python.org/dev/library/unittest.html\n\nLook for notes about features added or changed in Python 2.7.\n\n.. note::\n\n unittest2 is already in use for development of `distutils2\n <http://hg.python.org/distutils2>`_.\n\n Version 0.5.1 of unittest2 has feature parity with unittest_ in Python 2.7\n final. If you want to ensure that your tests run identically under unittest2\n and unittest in Python 2.7 you should use unittest2 0.5.1.\n\n Later versions of unittest2 include changes in unittest made in Python 3.2\n and onwards after the release of Python 2.7.\n\n\n.. _unittest: http://docs.python.org/release/2.7/library/unittest.html\n\n\nDifferences\n===========\n\nDifferences between unittest2 and unittest in Python 2.7:\n\n``assertItemsEqual`` does not silence Py3k warnings as this uses\n``warnings.catch_warnings()`` which is new in Python 2.6 (and is used as a\ncontext manager which would be a pain to make work with Python 2.4).\n\n``TestCase.longMessage`` defaults to True because it is better. It defaults to\nFalse in Python 2.7 for backwards compatibility reasons.\n\n``python -m package`` doesn't work in versions of Python before Python 2.7. The\ncommand line features of unittest2 are provided by a ``unit2`` (and\n``unit2.py``) script instead.\n\nunittest2 includes a very basic setuptools compatible test collector. Specify\n``test_suite = 'unittest2.collector'`` in your setup.py. This starts test\ndiscovery with the default parameters from the directory containing setup.py, so\nit is perhaps most useful as an example (see unittest2/collector.py).\n\nIn unittest2 TextTestResult.stopTestRun is responsible for calling printErrors.\nThis is desirable behaviour but in Python 3.1 TestResult.stopTestRun was\ndocumented as being empty and subclasses shouldn't need to call it. This would\nmake the change backwards incompatible and needs thinking about.\n\n\n\nIssues\n======\n\nA ``TestResult`` object with unexpected successes returns True\nfor ``result.wasSuccessful()``. Difficult to know if this is the correct\nbehaviour or not.\n\nIf a dotted path name is used for test discovery then a globally installed\nmodule/package will still be used in preference of one in the current\ndirectory. When doing discovery from a dotted path name we could check for this\nspecific case.\n\nThe ``removeHandler`` decorator could also be a context manager.\n\n`Issue 8313: <http://bugs.python.org/issue8313>`_, \\<unprintable AssertionError object\\>\nmessage in unittest tracebacks, is hard to fix in versions of Python before 2.7.\nThe fix in Python 2.7 relies on changes to both the traceback module and\ntraceback objects. As the issue is rare I am leaving it unfixed in unittest2.\n\nThere are several places in unittest2 (and unittest) that call ``str(...)`` on\nexceptions to get the exception message. This can fail if the exception was\ncreated with non-ascii unicode. This is rare and I won't address it unless it is\nactually reported as a problem for someone.\n\nA comparison of text or long sequences (using ``assertSequenceEqual`` or\n``assertMultiLineEqual`` etc) can take a *long* time to generate diffs for\nfailure messages. These methods use ``prettyprint`` and ``difflib``.\n\n``pip install -e .`` on Python3.2 in the unittest2 source will fail unless\nsetuptools > 0.6.24 is already installed. This is a combination of needing a\nnewer setuptools (to avoid the use of execfile) and setup_requires falling back\nto easy_install that doesn't know how to upgrade setuptools just-in-time that\nprevents it being fixed in unittest2.\n\n\nCHANGELOG\n=========\n\n2015-06-20 - 1.1.0\n------------------\n\n- Issue #15836: assertRaises(), assertRaisesRegex(), assertWarns() and\n assertWarnsRegex() assertments now check the type of the first argument\n to prevent possible user error. Based on patch by Daniel Wagner-Hall.\n\n- Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and\n assertWarnsRegex() checks now emits a deprecation warning when callable is\n None or keyword arguments except msg is passed in the context manager mode.\n\n- Issue #22903: The fake test case created by unittest.loader when it fails\n importing a test module is now picklable.\n\n\n2015-03-12 - 1.0.1\n------------------\n\n- Unittest2 issue #94: Need at least 1.4 of six.\n\n2015-03-06 - 1.0.0\n------------------\n\n- Issue #22936: Permit showing local variables in tracebacks.\n\n2014/11/05 - 0.8\n----------------\n\n- Issue #22457: Honour load_tests in the start_dir of discovery.\n\n- Issue #22894: TestCase.subTest() would cause the test suite to be stopped\n when in failfast mode, even in the absence of failures.\n\n2014/10/31 - 0.7.1\n------------------\n\nFix for 0.7.0 being broken. Also switches from both manual and entrypoint\nscripts to just entrypoint scripts to reduce the possibility of similar\noversights in future.\n\n2014/10/31 - 0.7.0\n------------------\n\nThis release contains backports from cPython 3.5 of all (I think) commits since\n2010, as of today.\n\n2014/10/28 - 0.6.0\n------------------\n\nMany thanks to Mark Roddy and Ezio Melotti who contributed substantially to\nthis release.\n\n* Changed supported Python versions to start at 2.6, and include all released 3.x\n and pypy. (Robert Collins)\n* Invoking `unit2` without args starts test discovery\n* Added `TestCase.assertWarns` and `TestCase.assertWarnsRegexp` context managers\n* Fix Python issue 9926. TestSuite subclasses that override __call__ are called\n correctly.\n* Removed unused `maxDiff` parameter from `TestCase.assertSequenceEqual`.\n* DeprecationWarning for unsupported result objects (missing addSkip method)\n became RuntimeWarning.\n* Addition of `TestCase.assertWarns` as a context manager.\n\n\n2010/07/12 - 0.5.1\n------------------\n\nReverted script names created by setuptools back to \"unit2\" instead of\n\"unit2.py\". (Not necessary as setuptools creates stub .exes for console scripts\nanyway.)\n\n\n2010/07/11 - 0.5.0\n------------------\n\nAddition of a setuptools compatible test collector (very basic). Specify\n``test_suite = 'unittest2.collector'`` in your setup.py.\n\n``TestSuite.debug()`` and ``TestCase.debug()`` now execute cleanup functions\nand class and module level setups and teardowns.\n\nNo longer monkey-patch os.path.relpath for Python 2.4 / 2.5 so that projects\ndon't accidentally depend on our patching. Contributed by Konrad Delong.\n\nAdded a Python version specific unit2 entrypoint. This will, for example,\ncreate a ``unit2-2.6`` script if unittest2 is installed with Python 2.6.\n(Requires setuptools or distribute.)\n\nPython 2.3 compatibility (in the python2.3 branch of the repository),\ncontributed by Mark Roddy.\n\nsetuptools console script entry points are created as '.py' scripts on Windows.\n\nFeature parity with the Python 2.7 final release.\n\n\n2010/06/06 - 0.4.2\n------------------\n\nImproved help message for ``unit2 discover -h``.\n\nSkipTest in unittest.TestCase.setUpClass or setUpModule is now reported as a\nskip rather than an error.\n\nExcessively large diffs due to ``TestCase.assertSequenceEqual`` are no\nlonger included in failure reports. (Controlled by ``TestCase.maxDiff``.)\n\nMatching files during test discovery is done in ``TestLoader._match_path``. This\nmethod can be overriden in subclasses to, for example, match on the full file\npath or use regular expressions for matching.\n\nAddition of a setuptools compatible entrypoint for the unit2 test runner script.\nContributed by Chris Withers.\n\nTests fixed to be compatible with Python 2.7, where deprecation warnings are\nsilenced by default.\n\nFeature parity with unittest in Python 2.7 RC 1.\n\n\n2010/05/09 - 0.4.1\n------------------\n\nIf test discovery imports a module from the wrong location (usually because the\nmodule is globally installed and the user is expecting to run tests against a\ndevelopment version in a different location) then discovery halts with an\n``ImportError`` and the problem is reported.\n\nAdded docstrings to ``assertRegexpMatches`` and ``assertNotRegexpMatches``.\n\nPutting functions in test suites no longer crashes.\n\nFeature parity with unittest in Python 2.7 Beta 2.\n\n2010/04/08 - 0.4.0\n------------------\n\nAddition of ``removeHandler`` for removing the control-C handler.\n\n``delta`` keyword argument for ``assertAlmostEqual`` and\n``assertNotAlmostEqual``.\n\nAddition of -b command line option (and ``TestResult.buffer``) for buffering\nstdout / stderr during test runs.\n\nAddition of ``TestCase.assertNotRegexpMatches``.\n\nAllow test discovery using dotted module names instead of a path.\n\nAll imports requiring the signal module are now optional, for compatiblity\nwith IronPython (or other platforms without this module).\n\nTests fixed to be compatible with nosetest.\n\n\n2010/03/26 - 0.3.0\n------------------\n\n``assertSameElements`` removed and ``assertItemsEqual`` added; assert that\nsequences contain the same elements.\n\nAddition of -f/--failfast command line option, stopping test run on first\nfailure or error.\n\nAddition of -c/--catch command line option for better control-C handling during\ntest runs.\n\nAdded ``BaseTestSuite``, for use by frameworks that don't want to support shared\nclass and module fixtures.\n\nSkipped test methods no longer have ``setUp`` and ``tearDown`` called around\nthem.\n\nFaulty ``load_tests`` functions no longer halt test discovery.\n\nUsing non-strings for failure messages now works.\n\nPotential for ``UnicodeDecodeError`` whilst creating failure messages fixed.\n\nSplit out monolithic test module into a package.\n\nBUGFIX: Correct usage message now shown for unit2 scripts.\n\nBUGFIX: ``__unittest`` in module globals trims frames from that module in\nreported stacktraces.\n\n\n2010/03/06 - 0.2.0\n------------------\n\nThe ``TextTestRunner`` is now compatible with old result objects and standard\n(non-TextTestResult) ``TestResult`` objects.\n\n``setUpClass`` / ``tearDownClass`` / ``setUpModule`` / ``tearDownModule`` added.\n\n\n2010/02/22 - 0.1.6\n------------------\n\nFix for compatibility with old ``TestResult`` objects. New tests can now be run\nwith nosetests (with a DeprecationWarning for ``TestResult`` objects without\nmethods to support skipping etc).\n\n\n0.1\n---\n\nInitial release.\n\n\nTODO\n====\n\n* Document ``SkipTest``, ``BaseTestSuite```\n\nRelease process\n===============\n\n1. Make sure there is an entry in the Changelog in this document.\n1. Update __version__ in unittest2/__init__.py\n1. Commit.\n1. Create a tag for the version (e.g. ``hg tag 0.6.0``)\n1. Push so there is no outstanding patches and no room for races.\n1. Run ``make release`` to build an sdist and wheel and upload to pypi.",
"bugtrack_url": null,
"license": "UNKNOWN",
"summary": "The new features in unittest backported to Python 2.4+.",
"version": "1.1.0",
"split_keywords": [
"unittest",
"testing",
"tests"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "4fb80726cfd1d8887a75e4a69b9da71a",
"sha256": "13f77d0875db6d9b435e1d4f41e74ad4cc2eb6e1d5c824996092b3430f088bb8"
},
"downloads": -1,
"filename": "unittest2-1.1.0-py2.py3-none-any.whl",
"has_sig": true,
"md5_digest": "4fb80726cfd1d8887a75e4a69b9da71a",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 96379,
"upload_time": "2015-06-30T06:48:35",
"upload_time_iso_8601": "2015-06-30T06:48:35.477761Z",
"url": "https://files.pythonhosted.org/packages/72/20/7f0f433060a962200b7272b8c12ba90ef5b903e218174301d0abfd523813/unittest2-1.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "f72dae5d44f091df36b6b513305ea000",
"sha256": "22882a0e418c284e1f718a822b3b022944d53d2d908e1690b319a9d3eb2c0579"
},
"downloads": -1,
"filename": "unittest2-1.1.0.tar.gz",
"has_sig": true,
"md5_digest": "f72dae5d44f091df36b6b513305ea000",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 81432,
"upload_time": "2015-06-30T06:48:27",
"upload_time_iso_8601": "2015-06-30T06:48:27.260646Z",
"url": "https://files.pythonhosted.org/packages/7f/c4/2b0e2d185d9d60772c10350d9853646832609d2f299a8300ab730f199db4/unittest2-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2015-06-30 06:48:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "unittest2"
}