refecator: move defaults applying back to ext, raise on passing Slot to Slot, and docs cleanup (#1214)

* refecator: move defaults applying back to ext, raise on passing Slot to Slot, and docs cleanup

* docs: fix typo
This commit is contained in:
Juro Oravec 2025-05-26 11:59:17 +02:00 committed by GitHub
parent bae0f28813
commit 55b1c8bc62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 317 additions and 147 deletions

View file

@ -116,6 +116,15 @@ class TestSlot:
slots={"first": "SLOT_FN"},
)
def test_render_raises_on_slot_instance_in_slot_constructor(self):
slot: Slot = Slot(lambda ctx: "SLOT_FN")
with pytest.raises(
ValueError,
match=re.escape("Slot received another Slot instance as `contents`"),
):
Slot(slot)
def test_render_slot_in_python__minimal(self):
def slot_fn(ctx: SlotContext):
assert ctx.context is None