Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm - added timeout to anthropic stream tests #712

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkgs/swarmauri/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ leptonai = "0.22.0"
flake8 = "^7.0" # Add flake8 as a development dependency
pytest = "^8.0" # Ensure pytest is also added if you run tests
pytest-asyncio = ">=0.24.0"
pytest-timeout = "^2.3.1"
python-dotenv = "^1.0.0"
jsonschema = "^4.18.5"

Expand All @@ -71,6 +72,7 @@ markers = [
"integration: Integration tests",
"acceptance: Acceptance tests",
"experimental: Experimental tests",
"timeout: mark test to timeout after X seconds",
]

log_cli = true
Expand Down
2 changes: 2 additions & 0 deletions pkgs/swarmauri/tests/unit/llms/AnthropicModel_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def test_preamble_system_context(anthropic_model, model_name):
assert isinstance(conversation.get_last().usage, UsageData)


@pytest.mark.timeout(30) # 30 second timeout
@pytest.mark.parametrize("model_name", get_allowed_models())
@pytest.mark.unit
def test_stream(anthropic_model, model_name):
Expand Down Expand Up @@ -155,6 +156,7 @@ async def test_apredict(anthropic_model, model_name):
assert isinstance(conversation.get_last().usage, UsageData)


@pytest.mark.timeout(30) # 30 second timeout
@pytest.mark.parametrize("model_name", get_allowed_models())
@pytest.mark.asyncio(loop_scope="session")
@pytest.mark.unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def test_predict(anthropic_tool_model, toolkit, conversation, model_name):
assert isinstance(conversation.get_last().content, str)


@pytest.mark.timeout(30)
@pytest.mark.unit
@pytest.mark.parametrize("model_name", get_allowed_models())
def test_stream(anthropic_tool_model, toolkit, conversation, model_name):
Expand Down Expand Up @@ -133,6 +134,7 @@ async def test_apredict(anthropic_tool_model, toolkit, conversation, model_name)
assert isinstance(prediction, str)


@pytest.mark.timeout(30)
@pytest.mark.unit
@pytest.mark.asyncio(loop_scope="session")
@pytest.mark.parametrize("model_name", get_allowed_models())
Expand Down