skillfed

expects

Expressive and extensible TDD/BDD assertion library for Python

expects v0.9.0 208.8K downloads/30d#9,524 on PyPI222
Permissive license Apache 2.0 DORMANT released

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 on this page — 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

expects on PyPI

pip

pip install expects

uv

uv add expects

poetry

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 not specified
Install friction high — source build required
Runtime dependencies none
Maintenance dormant — 2,850 days since the last release
Last repo commit
First released
Downloads 208,846/month — #9,524 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: expects-0.9.0.tar.gz

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: ImplementationProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

python assertion libraryBDD testing matchersTDD expectation syntaxfluent test assertionscustom matcher frameworkexpressive test expectationspython testing DSL
bdd-testingassertion-librarydormant

More Python Modules packages