re-assert
show where your regex match assertion failed!
Decision gist · record as of 2026-08-14
Yes. It is a focused, well-maintained tool with no security issues, low install friction, and a permissive license. If you write regex-based tests in pytest or other frameworks, it directly improves test readability and debugging speed with minimal overhead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6.1 or later; regex library must be installed (handled by pip).
- Low friction: pure Python wheel with a single runtime dependency on regex.
- Actively maintained with a recent commit in July 2026.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open and closed projects.
last release 2020-02-25 (2362 days) · last repo commit 2026-07-15 · 83 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 80,461 downloads/mo, #14,290 on PyPI
Alternatives
Verify before relying
pip install re-assert
from re_assert import Matches
# In a pytest test:
assert Matches('foo') == 'food' # passes
assert Matches('foo') == 'fork' # fails with clear diagnostic
# Or with assert_matches():
Matches('foo').assert_matches('food')- Whether regex library's 100% compatibility claim with re library extends to all edge cases in practice.
- Performance characteristics when used with complex patterns or large volumes of assertions.
What it is and what it does
re-assert wraps regex pattern matching to provide readable failure diagnostics in test assertions. When a pattern fails to match, it shows the exact position in the input string where the match broke down, with visual markers pointing to the failure point. This is especially useful in pytest, where the overridden equality operator integrates directly into assertion output; for other test frameworks, the `assert_matches()` method produces similarly clear tracebacks.
Under the hood, re-assert uses the regex library (which is a drop-in replacement for Python's built-in re module) to compile and match patterns. You construct a Matches object with a pattern string or an already-compiled regex, then use it like a normal value in equality assertions or call `assert_matches()` directly. The library is designed to be lightweight and requires only the regex dependency.
Use it for
- Write pytest tests for regex patterns with clear failure messages showing exactly where the match failed.
- Debug regex patterns during development by seeing the precise mismatch point instead of a generic False result.
- Test compiled regex objects from existing code without rewriting the pattern as a string.
- Use in non-pytest test frameworks via the assert_matches() method for readable regex validation errors.
- Validate input patterns in data pipelines where regex failures need to be quickly diagnosed.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
It is a focused, well-maintained tool with no security issues, low install friction, and a permissive license. If you write regex-based tests in pytest or other frameworks, it directly improves test readability and debugging speed with minimal overhead.
Install
re-assert on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency on regex. Actively maintained with a recent commit in July 2026.
Requires Python 3.6.1 or later; regex library must be installed (handled by pip).
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects.
Quickstart
pip install re-assert
from re_assert import Matches
# In a pytest test:
assert Matches('foo') == 'food' # passes
assert Matches('foo') == 'fork' # fails with clear diagnostic
# Or with assert_matches():
Matches('foo').assert_matches('food')
Verify before relying
- Whether regex library's 100% compatibility claim with re library extends to all edge cases in practice.
- Performance characteristics when used with complex patterns or large volumes of assertions.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6.1 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageregex |
| Maintenance | Actively maintained 2,362 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,461 / month, #14,290 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8 |
Evidence: re_assert-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 › “regex assertion testing”
- re-assertProvides a helper class for regex assertions that shows exactly where…
- robotframework-assertion-engineProvides a standardized assertion engine for Robot Framework…
- pytest-raisesProvides pytest markers (@pytest.mark.raises and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
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.
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.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also asserts · dirty-equals · pytest-assume · pytest-regex · pytest-unordered · pytest-deepassert · ensure · delayed-assert · pytest-mypy-plugins · pytest-reraise