mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
* test: move key-gated tests/test_litellm SDK tests into tests/llm_translation and drop empty folders * test: make token counter and health check unit tests run offline * ci: point unit shards, rust path filter, Makefile and docs at tests/unit * docs: fix stale test_litellm run paths in moved llm_translation tests * fix: correct databricks e2e sys.path depth and contributing example path --------- Co-authored-by: yuneng <yuneng@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
"""
|
|
e2b code execution sandbox - end-to-end integration tests.
|
|
|
|
These tests make REAL HTTP calls to the e2b API and are skipped automatically
|
|
unless E2B_API_KEY is set.
|
|
|
|
Run only these tests:
|
|
pytest tests/integration/sandbox/test_e2b_sandbox.py -v
|
|
"""
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
import litellm
|
|
|
|
|
|
@pytest.mark.skipif("E2B_API_KEY" not in os.environ, reason="needs a real E2B_API_KEY")
|
|
@pytest.mark.asyncio
|
|
async def test_integration_ephemeral_real_e2b():
|
|
result = await litellm.acode_interpreter_tool(
|
|
provider="e2b", code="print(sum(range(10)))"
|
|
)
|
|
assert result.stdout.strip() == "45"
|
|
assert result.error is None
|
|
|
|
|
|
@pytest.mark.skipif("E2B_API_KEY" not in os.environ, reason="needs a real E2B_API_KEY")
|
|
@pytest.mark.asyncio
|
|
async def test_integration_lifecycle_roundtrip_real_e2b():
|
|
container = await litellm.acreate_sandbox(provider="e2b")
|
|
try:
|
|
result = await litellm.arun_code(
|
|
provider="e2b", container=container, code="print(6*7)"
|
|
)
|
|
assert result.stdout.strip() == "42"
|
|
finally:
|
|
assert await litellm.adelete_sandbox(provider="e2b", container=container)
|