Skip to content

Commit 9a265e4

Browse files
timsaucerclaude
andcommitted
test(pickle): tighten refusal assertion from Exception to RuntimeError
`pytest.raises(Exception, ...)` matched too loosely — a regression that swallowed the codec refusal as some other error type would have passed the test. The actual surface error is `RuntimeError` (the `parse_expr` → `PyRuntimeError` conversion in `expr.rs::from_bytes`). Switch to the concrete type and add a brief comment explaining why. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4a8fadc commit 9a265e4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

python/tests/test_pickle_expr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,11 @@ def test_strict_decoder_refuses_inline_payload(self):
294294

295295
strict_receiver = SessionContext().with_python_udf_inlining(False)
296296
strict_receiver.register_udf(u)
297-
with pytest.raises(Exception, match="inlining is disabled"):
297+
# `RuntimeError` (not bare `Exception`): the codec refusal is
298+
# surfaced through `parse_expr` → `PyRuntimeError`. Tightening
299+
# the assertion catches a regression that swallows the refusal
300+
# as a different error type.
301+
with pytest.raises(RuntimeError, match="inlining is disabled"):
298302
Expr.from_bytes(blob, ctx=strict_receiver)
299303

300304
def test_sender_ctx_propagates_through_pickle(self):

0 commit comments

Comments
 (0)