skillfed

callee

Argument matchers for unittest.mock

callee v0.3.1 157.1K downloads/30d#10,767 on PyPI90
Permissive license BSD Abandoned released

What it is and what it does

callee is a matcher library that sits on top of unittest.mock, letting you write more expressive assertions about what arguments a mock was called with. Instead of choosing between exact equality (which makes tests brittle) or ANY wildcards (which are too loose), you can use matchers like GreaterThan(0), InstanceOf(SomeClass), or String() to assert on properties of the arguments without handcrafting call_args checks.

The library has no runtime dependencies and is pure Python. It was last released in December 2019 and is no longer actively maintained. The repository is not archived, but there have been no commits since September 2020. It targets Python 2.6 through 3.7 according to its classifiers, making it primarily useful for legacy codebases or when you are constrained to older Python versions.

Use it for:

  • Write mock assertions that check argument types or ranges without over-specifying exact values.
  • Reduce boilerplate in test code by replacing manual call_args inspection with readable matchers.
  • Test functions that accept objects of a certain class without caring about their exact identity.
  • Verify that numeric arguments fall within expected bounds or satisfy custom predicates.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides argument matchers for unittest.mock that let you assert on mock calls with fine-grained precision—matching on types, values, or custom conditions instead of exact equality or wildcards.

No, unless you are maintaining legacy code already using callee or are locked to Python 2.6–3.7. The package is abandoned and its target Python versions are out of support. Modern Python test suites should use unittest.mock's built-in features or a maintained alternative.

Install

callee on PyPI

pip

pip install callee

uv

uv add callee

poetry

poetry add callee

Installing callee

Before you install

High install friction: the package is abandoned (last release 2019-12-24, last commit 2020-09-11) with no runtime dependencies. It targets Python 2.6 through 3.7 per classifiers, which are now well out of support. Use only if you are locked to an old Python version or an existing codebase already using it.

License in practice

BSD license (permissive) places no restrictions on use, modification, or distribution in your own code.

Quickstart

pip install callee

from callee import GreaterThan, InstanceOf, String
from unittest.mock import Mock

m = Mock()
m(42, some_obj, 'text')
m.assert_called_with(GreaterThan(0), InstanceOf(object), String())

Requires unittest.mock (built-in Python 3.3+) or the mock backport for Python 2.6–2.7.

Verify before relying

  • Whether the package works reliably with modern Python versions (3.8+) despite classifiers only listing up to 3.7.
  • Current state of the repository and whether it accepts patches or is truly unmaintained.

Package facts

License BSD (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 2,425 days since the last release
Last repo commit
First released
Downloads 157,059/month — #10,767 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: callee-0.3.1.tar.gz

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Tags

mock argument matchersunittest.mock assertionsflexible mock call verificationmock call predicatestest mock matchersassert mock argumentsmock call validation
testingmocklegacy

More Testing packages