Skip to content

Commit cad8eaf

Browse files
committed
Simplify diff
1 parent 2d44b83 commit cad8eaf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_direct.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_model_request_stream_sync_without_context_manager():
119119
"""Test that accessing properties or iterating without context manager raises RuntimeError."""
120120
messages: list[ModelMessage] = [ModelRequest.user_text_prompt('x')]
121121

122-
expected_error_message = re.escape(
122+
expected_error_msg = re.escape(
123123
'StreamedResponseSync must be used as a context manager. Use: `with model_request_stream_sync(...) as stream:`'
124124
)
125125

@@ -129,22 +129,22 @@ def test_model_request_stream_sync_without_context_manager():
129129
assert 'StreamedResponseSync' in stream_repr
130130
assert 'context_entered=False' in stream_repr
131131

132-
with pytest.raises(RuntimeError, match=expected_error_message):
132+
with pytest.raises(RuntimeError, match=expected_error_msg):
133133
_ = stream_cm.model_name
134134

135-
with pytest.raises(RuntimeError, match=expected_error_message):
135+
with pytest.raises(RuntimeError, match=expected_error_msg):
136136
_ = stream_cm.timestamp
137137

138-
with pytest.raises(RuntimeError, match=expected_error_message):
138+
with pytest.raises(RuntimeError, match=expected_error_msg):
139139
stream_cm.get()
140140

141-
with pytest.raises(RuntimeError, match=expected_error_message):
141+
with pytest.raises(RuntimeError, match=expected_error_msg):
142142
stream_cm.usage()
143143

144-
with pytest.raises(RuntimeError, match=expected_error_message):
144+
with pytest.raises(RuntimeError, match=expected_error_msg):
145145
list(stream_cm)
146146

147-
with pytest.raises(RuntimeError, match=expected_error_message):
147+
with pytest.raises(RuntimeError, match=expected_error_msg):
148148
for _ in stream_cm:
149149
break # pragma: no cover
150150

0 commit comments

Comments
 (0)