pytest-tinybird
raw JSON → 0.5.0 verified Sat May 09 auth: no python
A pytest plugin that reports test results to Tinybird. Version 0.5.0 adds optional report parameters for multi-repository/multi-workflow. Release cadence is irregular.
pip install pytest-tinybird Common errors
error pytest: error: unrecognized arguments: --tinybird ↓
cause The plugin does not add custom command-line arguments; it uses environment variables only.
fix
Remove --tinybird from pytest command. Configure via env vars: TINYBIRD_TOKEN, TINYBIRD_DATASOURCE.
error Modulenotfounderror: No module named 'pytest_tinybird' ↓
cause The package is not installed or import is attempted explicitly.
fix
Install with pip: pip install pytest-tinybird. The plugin is auto-loaded; no explicit import needed.
error OSError: [Errno 0] Error: Could not find TINYBIRD_TOKEN ↓
cause Missing required environment variable.
fix
Set TINYBIRD_TOKEN environment variable before running pytest.
Warnings
gotcha The plugin uses TINYBIRD_TOKEN environment variable, not a config file. Ensure you set it before running pytest. ↓
fix Set TINYBIRD_TOKEN in your shell or CI environment.
gotcha In v0.4.0, a retry mechanism was added; if data is not acknowledged, it may be duplicated. ↓
fix Set TINYBIRD_WAIT=true to wait for Tinybird acknowledgment and reduce duplicates.
deprecated The default wait strategy is 'false' (no wait). In future versions, default may change. ↓
fix Explicitly set TINYBIRD_WAIT environment variable as needed.
gotcha Timeout defaults to 2 seconds. Large test suites may cause timeouts; adjust with TINYBIRD_TIMEOUT. ↓
fix Set TINYBIRD_TIMEOUT to a higher value (e.g., 10) if you experience failures.
Imports
- pytest_tinybird
import pytest_tinybird
Quickstart
# Install: pip install pytest-tinybird
# Set environment variables
import os
os.environ['TINYBIRD_TOKEN'] = 'your_token' # Required: Tinybird Events API token
os.environ['TINYBIRD_DATASOURCE'] = 'pytest_results' # Required: Datasource name
os.environ['TINYBIRD_API_URL'] = 'https://api.tinybird.co' # Optional, default shown
# Run pytest with the plugin (enabled by default)
# Example: pytest --tb=short tests/