Skip to content

Commit 716780b

Browse files
RobertCraigiestainless-app[bot]
authored andcommitted
fix(tests): avoid deprecation warnings
1 parent 46e4b98 commit 716780b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tests/lib/streaming/fixtures/basic_response.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
event: message_start
2-
data: {"type":"message_start","message":{"id":"msg_4QpJur2dWWDjF6C758FbBw5vm12BaVipnK","type":"message","role":"assistant","content":[],"model":"claude-3-opus-20240229","stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":11,"output_tokens":1}}}
2+
data: {"type":"message_start","message":{"id":"msg_4QpJur2dWWDjF6C758FbBw5vm12BaVipnK","type":"message","role":"assistant","content":[],"model":"claude-3-opus-latest","stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":11,"output_tokens":1}}}
33

44
event: content_block_start
55
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

tests/lib/streaming/test_beta_messages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Expected message fixtures
3131
EXPECTED_BASIC_MESSAGE = {
3232
"id": "msg_4QpJur2dWWDjF6C758FbBw5vm12BaVipnK",
33-
"model": "claude-3-opus-20240229",
33+
"model": "claude-3-opus-latest",
3434
"role": "assistant",
3535
"stop_reason": "end_turn",
3636
"type": "message",
@@ -200,7 +200,7 @@ def test_basic_response(self, respx_mock: MockRouter) -> None:
200200
"content": "Say hello there!",
201201
}
202202
],
203-
model="claude-3-opus-20240229",
203+
model="claude-3-opus-latest",
204204
) as stream:
205205
assert isinstance(cast(Any, stream), BetaMessageStream)
206206

@@ -240,7 +240,7 @@ def test_context_manager(self, respx_mock: MockRouter) -> None:
240240
"content": "Say hello there!",
241241
}
242242
],
243-
model="claude-3-opus-20240229",
243+
model="claude-3-opus-latest",
244244
) as stream:
245245
assert not stream.response.is_closed
246246

@@ -301,7 +301,7 @@ async def test_context_manager(self, respx_mock: MockRouter) -> None:
301301
"content": "Say hello there!",
302302
}
303303
],
304-
model="claude-3-opus-20240229",
304+
model="claude-3-opus-latest",
305305
) as stream:
306306
assert not stream.response.is_closed
307307

tests/lib/streaming/test_messages.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
def assert_basic_response(events: list[MessageStreamEvent], message: Message) -> None:
3030
assert message.id == "msg_4QpJur2dWWDjF6C758FbBw5vm12BaVipnK"
31-
assert message.model == "claude-3-opus-20240229"
31+
assert message.model == "claude-3-opus-latest"
3232
assert message.role == "assistant"
3333
assert message.stop_reason == "end_turn"
3434
assert message.stop_sequence is None
@@ -120,7 +120,7 @@ def test_basic_response(self, respx_mock: MockRouter) -> None:
120120
"content": "Say hello there!",
121121
}
122122
],
123-
model="claude-3-opus-20240229",
123+
model="claude-3-opus-latest",
124124
) as stream:
125125
with pytest.warns(DeprecationWarning):
126126
assert isinstance(cast(Any, stream), Stream)
@@ -141,7 +141,7 @@ def test_context_manager(self, respx_mock: MockRouter) -> None:
141141
"content": "Say hello there!",
142142
}
143143
],
144-
model="claude-3-opus-20240229",
144+
model="claude-3-opus-latest",
145145
) as stream:
146146
assert not stream.response.is_closed
147147

@@ -202,7 +202,7 @@ async def test_basic_response(self, respx_mock: MockRouter) -> None:
202202
"content": "Say hello there!",
203203
}
204204
],
205-
model="claude-3-opus-20240229",
205+
model="claude-3-opus-latest",
206206
) as stream:
207207
with pytest.warns(DeprecationWarning):
208208
assert isinstance(cast(Any, stream), AsyncStream)
@@ -224,7 +224,7 @@ async def test_context_manager(self, respx_mock: MockRouter) -> None:
224224
"content": "Say hello there!",
225225
}
226226
],
227-
model="claude-3-opus-20240229",
227+
model="claude-3-opus-latest",
228228
) as stream:
229229
assert not stream.response.is_closed
230230

0 commit comments

Comments
 (0)