Skip to main content

HookHappens, the Python client

HookHappens ("Mock around & find out") stands in for the endpoints your system calls, or sits in front of the real ones. A test changes exactly the part of the answer it needs, and you see what your system did with it. The service lives at https://hookhappens.com; this package is the Python client and the pytest plugin for it.

pip install hookhappens
from hookhappens import HookHappens

with HookHappens("https://hookhappens.com", api_key="hh_…") as hh:
    with hh.new_namespace("snack-bar") as run:         # a throwaway address for this test run
        run.rule("order-snack", then=[{"status": 503}])  # the kitchen is on fire
        my_app.order("cookie", 3, kitchen=run.url)       # point your system at it
        call = run.wait_for("order-snack")               # the call your system made, with its answer
        assert call.status == 503

With pytest, the hh fixture does the same with no setup beyond two environment variables:

export HOOKHAPPENS_URL=https://hookhappens.com
export HOOKHAPPENS_API_KEY=hh_…
pytest
def test_the_kitchen_on_fire(hh):
    hh.scenario_on("kitchen-on-fire")
    my_app.order("cookie", 3, kitchen=hh.url)
    assert hh.wait_for(endpoint="order-snack").status == 503

The whole story, with a runnable example app and its test suite, is the Testing your system guide: https://hookhappens.com/#/how-to/testing. The service is hosted only; nothing to install but this client. © 2026 Carolina Shulman Grigoriev. All rights reserved.

Metadata

Release files for hookhappens 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hookhappens 0.1.1
File Size Uploaded Provenance Actions
hookhappens-0.1.1.tar.gz 9.7 kB Without provenance Details for hookhappens-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hookhappens 0.1.1
File Interpreter ABI Platform Actions
hookhappens-0.1.1-py3-none-any.whl Python 3 none any Details for hookhappens-0.1.1-py3-none-any.whl

Total release size: 21.0 kB

Release files / hookhappens-0.1.1.tar.gz

Download URL hookhappens-0.1.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5e76c18188f51b3359dec5ff88d0b4f61f863f7663165a35074dc1efbbccd0c2
BLAKE2b-256 checksum
How to use checksums
abb2f3cce57e6a3ac68c1a4a8b6e971bc78d01a69f90d98072f8392c7cc58aa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / hookhappens-0.1.1-py3-none-any.whl

Download URL hookhappens-0.1.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dbe75997a67b929dc7b0674d924429adecc7fa9e451cb735ec2d21542edafa5
BLAKE2b-256 checksum
How to use checksums
11296b64875073787b66611df69e775bd1b892696cd3cab7e74c27e471b4eaeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Security for hookhappens 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page