Skip to content

Commit c033eeb

Browse files
committed
chore: drop unrelated ci and aws test noise
1 parent fed36d7 commit c033eeb

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ jobs:
7777
7878
echo "Current cohere installation: $(poetry show cohere)"
7979
make test
80-
81-
# Skip test_langchain_tool_calling_agent: uses deprecated models and hits
82-
# the live API without temperature=0, causing non-deterministic failures.
83-
# See https://github.com/cohere-ai/cohere-python/pull/738
84-
poetry run pytest tests/integration_tests/ --deselect tests/integration_tests/test_langgraph_agents.py::test_langchain_tool_calling_agent
80+
make integration_test
8581
echo "tests passed"
8682
8783
# reset poetry changes

tests/test_aws_client_unit.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,27 @@
1010
import inspect
1111
import json
1212
import os
13+
import sys
14+
import types
1315
import unittest
1416
from unittest.mock import MagicMock, patch
1517

1618
import httpx
1719

1820
from cohere.manually_maintained.cohere_aws.mode import Mode
1921

22+
if "tokenizers" not in sys.modules:
23+
tokenizers_stub = types.ModuleType("tokenizers")
24+
tokenizers_stub.Tokenizer = object
25+
sys.modules["tokenizers"] = tokenizers_stub
26+
27+
if "fastavro" not in sys.modules:
28+
fastavro_stub = types.ModuleType("fastavro")
29+
fastavro_stub.parse_schema = lambda schema: schema
30+
fastavro_stub.reader = lambda *args, **kwargs: iter(())
31+
fastavro_stub.writer = lambda *args, **kwargs: None
32+
sys.modules["fastavro"] = fastavro_stub
33+
2034

2135
class TestSigV4HostHeader(unittest.TestCase):
2236
"""Fix 1: The headers dict passed to AWSRequest for SigV4 signing must
@@ -47,8 +61,11 @@ def capture_aws_request(**kwargs): # type: ignore
4761
mock_session.get_credentials.return_value = MagicMock()
4862
mock_boto3.Session.return_value = mock_session
4963

50-
with patch("cohere.aws_client.lazy_botocore", return_value=mock_botocore), \
51-
patch("cohere.aws_client.lazy_boto3", return_value=mock_boto3):
64+
import cohere.aws_client as aws_client_module
65+
66+
with patch.object(aws_client_module, "lazy_botocore", return_value=mock_botocore), patch.object(
67+
aws_client_module, "lazy_boto3", return_value=mock_boto3
68+
):
5269

5370
from cohere.aws_client import map_request_to_bedrock
5471

@@ -58,7 +75,7 @@ def capture_aws_request(**kwargs): # type: ignore
5875
method="POST",
5976
url="https://api.cohere.com/v1/chat",
6077
headers={"connection": "keep-alive"},
61-
json={"model": "cohere.I gues-v1:0", "message": "hello"},
78+
json={"model": "cohere.command-r-plus-v1:0", "message": "hello"},
6279
)
6380

6481
self.assertEqual(request.url.host, "api.cohere.com")

0 commit comments

Comments
 (0)