Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pytest-apibean

pytest-apibean is a pytest plugin that provides a unified, reusable testing foundation for projects built on the apibean ecosystem.

It is designed to work hand-in-hand with apibean-client to test API-driven services such as:

  • apibean-rest – RESTful API layers
  • apibean-datacore – backend data services and gateways
  • Other apibean-based microservices and integrations

Why pytest-apibean?

Testing API-centric systems often leads to repeated boilerplate: creating HTTP clients, handling authentication, managing tokens, configuring base URLs, and wiring environment-specific settings.

pytest-apibean solves this by providing:

  • A preconfigured httpx client for async API testing
  • Authentication and token management fixtures
  • Autouse setup hooks for consistent test environments
  • Centralized configuration via pyproject.toml
  • Seamless integration with apibean-client abstractions

All without forcing application-specific logic into your test suite.

apibean-client as the testing backbone

Rather than testing APIs using raw HTTP calls alone, pytest-apibean encourages a client-oriented testing model:

  • Business logic is exercised through apibean-client
  • Transport details remain encapsulated
  • Tests become more stable, expressive, and future-proof

This approach aligns unit tests, integration tests, and contract tests around the same client interface used by real consumers.

Configuration-first design

pytest-apibean follows a pyproject-first philosophy.

All test-related options can be configured via:

[tool.pytest.apibean.options]
base_url = "http://localhost:8080/api/v1"
login_path = "/auth/login"
timeout = 10.0
auto_login = true

Configuration precedence is explicit and predictable:

  1. Test fixtures
  2. pyproject.toml
  3. Environment variables
  4. Built-in defaults

Designed for real-world testing

pytest-apibean is built for:

  • Async-first APIs
  • Token-based authentication
  • Multi-service environments
  • CI-friendly workflows
  • Long-lived OSS projects

It avoids global state, supports namespace packaging, and integrates cleanly with modern tooling such as uv, httpx, and pytest >= 7.

Typical use cases

  • Integration testing for apibean-rest
  • Contract testing between services and apibean-datacore
  • End-to-end testing via apibean-client
  • Shared testing infrastructure across multiple apibean projects

Philosophy

pytest-apibean is intentionally minimal and opinionated:

  • It provides infrastructure, not test logic
  • It favors explicit configuration over magic
  • It scales from a single service to a multi-repo ecosystem

If you are building APIs with apibean, pytest-apibean lets you test them consistently, correctly, and with confidence.

Metadata

Release files for pytest-apibean 0.1.0a3

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

Source distribution (sdist)

Source distribution for pytest-apibean 0.1.0a3
File Size Uploaded
pytest_apibean-0.1.0a3.tar.gz 34.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-apibean 0.1.0a3
File Interpreter ABI Platform
pytest_apibean-0.1.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 74.8 kB

Release files / pytest_apibean-0.1.0a3.tar.gz

Download URL pytest_apibean-0.1.0a3.tar.gz
Size 34.4 kB
Tags Source
SHA-256 checksum
How to use checksums
85c35bdfb32b079762480ed67a25b8cbb8e38ff7921cdfd611ee08c7ba543d78
BLAKE2b-256 checksum
How to use checksums
a7e0cbe44dcbf9338a9c776c73b00f6446b074f3dae678a99ae98bf991dd93af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / pytest_apibean-0.1.0a3-py3-none-any.whl

Download URL pytest_apibean-0.1.0a3-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32695a1207038c292c12ed956e26aa1fb259099ff39c20df3c9f287981c05090
BLAKE2b-256 checksum
How to use checksums
24cf16861a9ff9c1f98f7e8a4e4552d6c9a1511d1967ee09a517443f5aa24d4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5
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