Skip to content

Commit c8ea5ce

Browse files
committed
uncomment out tests
1 parent b859ca1 commit c8ea5ce

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

test/test_tool_calls.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,34 @@ def test_add_tools_from_context_actions():
119119
assert tools["tool2"] == ftc1.tool2, f"{tools["tool2"]} should == {ftc1.tool2}"
120120

121121

122-
# def test_tool_called(m: MelleaSession, table: Table):
123-
# """We don't force tools to be called. As a result, this test might unexpectedly fail."""
124-
# r = 10
125-
126-
# returned_tool = False
127-
# for i in range(r):
128-
# transformed = m.transform(table, "add a new row to this table")
129-
# if isinstance(transformed, Table):
130-
# returned_tool = True
131-
# break
132-
133-
# assert returned_tool, f"did not return a tool after {r} attempts"
134-
135-
136-
# def test_tool_not_called(m: MelleaSession, table: Table):
137-
# """Ensure tools aren't always called when provided."""
138-
# r = 10
139-
140-
# returned_no_tool = False
141-
# for i in range(r):
142-
# transformed = m.transform(table, "output a text description of this table")
143-
# if isinstance(transformed, ModelOutputThunk):
144-
# returned_no_tool = True
145-
# break
146-
147-
# assert (
148-
# returned_no_tool
149-
# ), f"only returned tools after {r} attempts, should've returned a response with no tools"
122+
def test_tool_called(m: MelleaSession, table: Table):
123+
"""We don't force tools to be called. As a result, this test might unexpectedly fail."""
124+
r = 10
125+
126+
returned_tool = False
127+
for i in range(r):
128+
transformed = m.transform(table, "add a new row to this table")
129+
if isinstance(transformed, Table):
130+
returned_tool = True
131+
break
132+
133+
assert returned_tool, f"did not return a tool after {r} attempts"
134+
135+
136+
def test_tool_not_called(m: MelleaSession, table: Table):
137+
"""Ensure tools aren't always called when provided."""
138+
r = 10
139+
140+
returned_no_tool = False
141+
for i in range(r):
142+
transformed = m.transform(table, "output a text description of this table")
143+
if isinstance(transformed, ModelOutputThunk):
144+
returned_no_tool = True
145+
break
146+
147+
assert (
148+
returned_no_tool
149+
), f"only returned tools after {r} attempts, should've returned a response with no tools"
150150

151151
if __name__ == "__main__":
152152
pytest.main([__file__])

0 commit comments

Comments
 (0)