Skip to content

Commit 553450f

Browse files
committed
bare callables not allowed
1 parent 2b4449a commit 553450f

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

tests/test_handlers_llm_encoding.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -727,21 +727,6 @@ class Person(pydantic.BaseModel):
727727
class TestCallableEncodable:
728728
"""Tests for CallableEncodable - encoding/decoding callables as SynthesizedFunction."""
729729

730-
def test_bare_callable_allows_encode_but_not_decode(self):
731-
def add(a: int, b: int) -> int:
732-
return a + b
733-
734-
# Bare Callable allows encoding
735-
encodable = Encodable.define(Callable, {})
736-
encoded = encodable.encode(add)
737-
assert isinstance(encoded, SynthesizedFunction)
738-
assert "def add" in encoded.module_code
739-
740-
# But decode is disabled
741-
with pytest.raises(TypeError, match="Cannot decode/synthesize callable"):
742-
with handler(UnsafeEvalProvider()):
743-
encodable.decode(encoded)
744-
745730
def test_encode_decode_function(self):
746731
def add(a: int, b: int) -> int:
747732
return a + b

0 commit comments

Comments
 (0)