unittest2
The new features in unittest backported to Python 2.4+.
Decision gist · record as of 2026-08-14
No. The package has been abandoned since 2015 and targets Python versions that reached end-of-life over a decade ago. Modern Python includes all these features natively. Install only if you are maintaining a legacy codebase stuck on Python 2.6 or earlier that cannot be upgraded; otherwise, use the standard unittest module.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Targets Python 2.4, 2.5, 2.6, 2.7, 3.2, 3.3, 3.4 and pypy; modern Python versions include these features natively.
- Installation is straightforward with no runtime dependencies.
- However, the package has been abandoned since 2015 and is no longer maintained.
License · maintenance · safety
UNKNOWN (permissive) — Licensed under BSD (permissive), so there are no restrictions on use in proprietary or open-source projects.
last release 2015-06-30 (4063 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,292,386 downloads/mo, #4,101 on PyPI
Alternatives
Verify before relying
pip install unittest2
import unittest2
class TestExample(unittest2.TestCase):
def test_something(self):
self.assertEqual(1, 1)- Whether unittest2 remains compatible with modern Python tooling and CI/CD systems despite its age.
- Current state of the mercurial repository and whether it is still accessible or archived.
What it is and what it does
unittest2 is a backport of unittest improvements introduced in Python 2.7 and later versions, designed to run on older Python releases. It provides a drop-in replacement for the standard unittest module by allowing you to import unittest2 instead of unittest, giving access to modern testing features on legacy Python versions.
The package includes enhancements such as additional assert methods with better comparison defaults, assertRaises as a context manager, test discovery, class and module-level fixtures (setUpClass, tearDownClass, setUpModule, tearDownModule), test skipping, and improved command-line tools via the unit2 script. It has no runtime dependencies and installs as a pure Python wheel.
Use it for
- Maintaining test suites on Python 2.6 systems that need modern assertion methods without upgrading the Python version.
- Running test discovery on legacy Python versions before 2.7 introduced the feature natively.
- Using assertRaises as a context manager on Python 2.6 codebases.
- Accessing class-level and module-level test fixtures on older Python releases.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package has been abandoned since 2015 and targets Python versions that reached end-of-life over a decade ago. Modern Python includes all these features natively. Install only if you are maintaining a legacy codebase stuck on Python 2.6 or earlier that cannot be upgraded; otherwise, use the standard unittest module.
Install
unittest2 on PyPI
Before you install
Installation is straightforward with no runtime dependencies. However, the package has been abandoned since 2015 and is no longer maintained.
Targets Python 2.4, 2.5, 2.6, 2.7, 3.2, 3.3, 3.4 and pypy; modern Python versions include these features natively.
License in practice
Licensed under BSD (permissive), so there are no restrictions on use in proprietary or open-source projects.
Quickstart
pip install unittest2
import unittest2
class TestExample(unittest2.TestCase):
def test_something(self):
self.assertEqual(1, 1)
Verify before relying
- Whether unittest2 remains compatible with modern Python tooling and CI/CD systems despite its age.
- Current state of the mercurial repository and whether it is still accessible or archived.
Package facts
| License | UNKNOWN permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 4,063 days since the last release |
| First released | |
| Downloads | 1,292,386 / month, #4,101 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.4Programming Language :: Python :: 2.5Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Testing |
Evidence: unittest2-1.1.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “unittest backport”
- unittest2Backports unittest features from Python 2.7 and later versions to…
- unittest-parametrizeAdds parametrization support to unittest TestCases, allowing you to…
- parametrizeProvides a `@parametrize` decorator that works with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also traceback2 · configparser2 · multiprocessing · backports.tempfile · testtools · nose2 · linecache2 · vcrpy-unittest · functools32