Skip to content

Commit 9f2e4b3

Browse files
tode-rlcursoragent
andcommitted
Revert unrelated pyright fixes in adapter tests.
Keep the branch focused on Runloop rollout changes only. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6fc5c54 commit 9f2e4b3

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

tests/adapters/test_fireworks_tracing_logprobs.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def test_attaches_completion_logprobs_and_message_logprobs(self):
7171

7272
assistant = row.messages[-1]
7373
assert assistant.role == "assistant"
74-
assert assistant.logprobs is not None
7574
content = assistant.logprobs["content"]
7675
assert len(content) == len(extra["completion_logprobs"])
7776
assert content[0]["token_id"] == 10
@@ -84,13 +83,10 @@ def test_omits_token_id_keys_when_any_missing(self):
8483
assert row is not None
8584

8685
extra = row.execution_metadata.extra
87-
assert extra is not None
8886
assert "completion_logprobs" in extra
8987
assert "completion_token_ids" not in extra
9088

91-
logprobs = row.messages[-1].logprobs
92-
assert logprobs is not None
93-
content = logprobs["content"]
89+
content = row.messages[-1].logprobs["content"]
9490
assert len(content) == 2
9591
assert all("token_id" not in entry for entry in content)
9692
assert content[0]["logprob"] == pytest.approx(-0.1)

tests/adapters/test_r3_deserializer.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ def test_all_mode_uint8(self):
143143
assert metadata["replayed_token_count"] == total_tokens
144144

145145
for i in range(total_tokens):
146-
matrix = matrices[i]
147-
assert matrix is not None
148-
decoded = base64.b64decode(matrix)
146+
assert matrices[i] is not None
147+
decoded = base64.b64decode(matrices[i])
149148
assert decoded == matrices_raw[i]
150149

151150
def test_suffix_mode(self):
@@ -181,9 +180,8 @@ def test_suffix_mode(self):
181180
# Positions from start_token to start_token+replayed should have data
182181
for i in range(replayed):
183182
pos = start_token + i
184-
matrix = matrices[pos]
185-
assert matrix is not None
186-
decoded = base64.b64decode(matrix)
183+
assert matrices[pos] is not None
184+
decoded = base64.b64decode(matrices[pos])
187185
assert decoded == matrices_raw[i]
188186

189187
def test_bitmap_mode(self):
@@ -222,10 +220,9 @@ def test_bitmap_mode(self):
222220

223221
for i in range(total_tokens):
224222
if i in replayed_positions:
225-
matrix = matrices[i]
226-
assert matrix is not None
223+
assert matrices[i] is not None
227224
idx = replayed_positions.index(i)
228-
decoded = base64.b64decode(matrix)
225+
decoded = base64.b64decode(matrices[i])
229226
assert decoded == matrices_raw[idx]
230227
else:
231228
assert matrices[i] is None
@@ -252,9 +249,7 @@ def test_uint16_dtype(self):
252249
assert metadata["routing_dtype"] == "uint16"
253250
assert len(matrices) == total_tokens
254251
for i in range(total_tokens):
255-
matrix = matrices[i]
256-
assert matrix is not None
257-
decoded = base64.b64decode(matrix)
252+
decoded = base64.b64decode(matrices[i])
258253
assert decoded == matrices_raw[i]
259254

260255
def test_zero_replayed_tokens(self):
@@ -307,7 +302,6 @@ def test_high_compression_ratio_payload(self):
307302
assert len(matrices) == total_tokens
308303
assert metadata["replayed_token_count"] == total_tokens
309304
for m in matrices:
310-
assert m is not None
311305
assert base64.b64decode(m) == b"\x00" * matrix_elem_size
312306

313307

0 commit comments

Comments
 (0)