mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-16 04:18:35 +00:00
chore: restructure test env, cassettes, and conftest; fix flaky tests
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Consolidates pytest config, standardizes env handling, reorganizes cassette layout, removes outdated VCR configs, improves sync with threading.Condition, updates event-waiting logic, ensures cleanup, regenerates Gemini cassettes, and reverts unintended test changes.
This commit is contained in:
@@ -34,7 +34,7 @@ def test_openai_completion_is_used_when_no_provider_prefix():
|
||||
assert llm.provider == "openai"
|
||||
assert llm.model == "gpt-4o"
|
||||
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
@pytest.mark.vcr()
|
||||
def test_openai_is_default_provider_without_explicit_llm_set_on_agent():
|
||||
"""
|
||||
Test that OpenAI is the default provider when no explicit LLM is set on the agent
|
||||
@@ -302,7 +302,7 @@ def test_openai_completion_with_tools():
|
||||
assert call_kwargs['tools'] is not None
|
||||
assert len(call_kwargs['tools']) > 0
|
||||
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
@pytest.mark.vcr()
|
||||
def test_openai_completion_call_returns_usage_metrics():
|
||||
"""
|
||||
Test that OpenAICompletion.call returns usage metrics
|
||||
@@ -530,7 +530,7 @@ def test_openai_streaming_with_response_model():
|
||||
assert "text_format" not in call_kwargs
|
||||
|
||||
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
@pytest.mark.vcr()
|
||||
def test_openai_response_format_with_pydantic_model():
|
||||
"""
|
||||
Test that response_format with a Pydantic BaseModel returns structured output.
|
||||
@@ -551,7 +551,7 @@ def test_openai_response_format_with_pydantic_model():
|
||||
assert 0 <= result.confidence <= 1
|
||||
|
||||
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
@pytest.mark.vcr()
|
||||
def test_openai_response_format_with_dict():
|
||||
"""
|
||||
Test that response_format with a dict returns JSON output.
|
||||
@@ -565,7 +565,7 @@ def test_openai_response_format_with_dict():
|
||||
assert "status" in parsed
|
||||
|
||||
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
@pytest.mark.vcr()
|
||||
def test_openai_response_format_none():
|
||||
"""
|
||||
Test that when response_format is None, the API returns plain text.
|
||||
|
||||
Reference in New Issue
Block a user