--- id: expects version: "0.9.0" license: Apache 2.0 license_treatment: permissive maintenance: dormant --- # expects — Expressive and extensible TDD/BDD assertion library for Python License: permissive · Maintenance: dormant · Downloads: 208.8K/mo ## What it is and what it does Expects is a TDD/BDD assertion library that provides a fluent, composable syntax for writing test expectations. Instead of traditional assert statements, you use an `expect()` function paired with matchers (like `be_empty`, `equal`, `have_key`) chained with `.to()` or `.not_to()` to express what you expect from your code. The library supports combining matchers with `&` (and) and `|` (or) operators, and you can define custom matchers to extend its behavior. The package has no runtime dependencies, making it lightweight to install. However, it is dormant—the last release was 2018-10-25, and it carries classifiers for Python 2.7, 3.5, 3.6, and 3.7, which are all end-of-life. No updates or security patches have been released in 2850 days, so using it on modern Python versions is risky and unsupported. Use it for: - Writing readable BDD-style test assertions in test suites where fluent syntax improves clarity over raw assert statements. - Defining custom matchers for domain-specific test assertions that are reusable across a test suite. - Testing exception behavior with matchers like `raise_error` to verify that code fails as expected. - Composing complex assertions on data structures (dicts, lists) using chainable matchers and logical operators. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Expects is an assertion library for TDD/BDD that lets you write test expectations using a fluent, composable matcher syntax with support for custom matchers. No. The package is dormant (last release 2018-10-25) and targets end-of-life Python versions (2.7, 3.5, 3.6, 3.7). Compatibility with later Python versions is unverified and likely broken. For modern TDD/BDD assertion libraries, consider actively maintained alternatives. ## Install pip install expects uv add expects poetry add expects ## Installing expects Before you install: Installation friction is high—the package is dormant (last release 2018-10-25, no updates in 2850 days) and carries classifiers for Python 2.7, 3.5, 3.6, and 3.7, making it a poor fit for modern Python environments. The repo is not archived but shows no active maintenance. License in practice: Licensed under Apache 2.0 (permissive), so you can use it freely in commercial and open-source projects without restriction, though the dormant status means no legal updates or security patches are forthcoming. Quickstart: pip install expects from expects import expect, be_empty, equal expect([]).to(be_empty) expect('Foo').to(equal('Foo')) The package targets Python 2.7, 3.5, 3.6, and 3.7; compatibility with later Python versions is unverified. Verify before relying: - Whether the package actually works on Python versions released after 3.7. - Whether custom matchers can be defined and composed as the description suggests in practice. - Current test coverage and whether the built-in matchers cover common assertion patterns. ## Package facts - License: Apache 2.0 (permissive) - Python support: unspecified - Install friction: high - Maintenance: dormant - Downloads: 208.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python assertion library, BDD testing matchers, TDD expectation syntax, fluent test assertions, custom matcher framework, expressive test expectations, python testing DSL, bdd-testing, assertion-library, dormant [View on SkillFed](https://skillfed.io/packages/expects) · [View on PyPI](https://pypi.org/project/expects/)