azuredol.testing#
Testing helpers for azuredol — Azurite fixture and convenience builders.
The Azurite-backed pieces require Docker to be available locally. Unit tests that don’t
need a live container should prototype with dict() per the dol convention.
Functions
|
Context manager that ensures Azurite is running for the duration. |
Return True if Azurite's blob endpoint (port 10000) is reachable. |
|
Return True if the |
|
|
Build a |
Importable as a pytest fixture body. Use it like::. |
- azuredol.testing.azurite(container_name=None, *, wait=5.0)[source]#
Context manager that ensures Azurite is running for the duration.
If Azurite is already up (port 10000 reachable), do nothing on enter/exit. Otherwise start it via
docker runand stop it on exit.- Parameters:
- Yields:
The Azurite connection string.
- Raises:
RuntimeError – if Docker is unavailable and Azurite is not already running.
- azuredol.testing.azurite_is_running()[source]#
Return True if Azurite’s blob endpoint (port 10000) is reachable.
- Return type:
- azuredol.testing.mk_test_store(container=None, *, prefix='', create_container_if_missing=True)[source]#
Build a
ContainerStorepointing at Azurite, ready for ad-hoc testing.Requires Azurite to be running. Use the
azurite(...)context manager to ensure it.- Parameters:
- Return type:
- azuredol.testing.pytest_azurite_connection()[source]#
Importable as a pytest fixture body. Use it like:
import pytest from azuredol.testing import pytest_azurite_connection @pytest.fixture(scope='session') def azurite_connection(): yield from pytest_azurite_connection()
Skips the test session if Azurite cannot be started.