Pytest plugin providing apibean-based API testing fixtures integrated with apibean-client, designed for testing apibean REST services and datacore backends.
Project description
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:
- Test fixtures
pyproject.toml- Environment variables
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_apibean-0.1.0a3.tar.gz.
File metadata
- Download URL: pytest_apibean-0.1.0a3.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85c35bdfb32b079762480ed67a25b8cbb8e38ff7921cdfd611ee08c7ba543d78
|
|
| MD5 |
182386ac8b2577f8ec567c46884ce40b
|
|
| BLAKE2b-256 |
a7e0cbe44dcbf9338a9c776c73b00f6446b074f3dae678a99ae98bf991dd93af
|
File details
Details for the file pytest_apibean-0.1.0a3-py3-none-any.whl.
File metadata
- Download URL: pytest_apibean-0.1.0a3-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32695a1207038c292c12ed956e26aa1fb259099ff39c20df3c9f287981c05090
|
|
| MD5 |
b6588cdfb8099041bf94cf68263595b2
|
|
| BLAKE2b-256 |
24cf16861a9ff9c1f98f7e8a4e4552d6c9a1511d1967ee09a517443f5aa24d4f
|