Skip to content

Commit e1f93ed

Browse files
Merge branch 'main' of github.com:invariantlabs-ai/docs
2 parents de398d6 + c2819bc commit e1f93ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/testing/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export OPENAI_API_KEY=<your-key>
3030

3131
```python
3232
# content of tests/test_weather.py
33+
import invariant.testing.functional as F
3334
from invariant.testing import Trace, assert_equals
3435

3536
def test_weather():
@@ -47,7 +48,7 @@ def test_weather():
4748
locations = trace.messages()[-1]["content"].extract("locations")
4849

4950
# assert that the agent responded about Paris and only Paris
50-
assert_equals(1, locations.len(),
51+
assert_equals(1, F.len(locations),
5152
"The agent should respond about one location only")
5253

5354
assert_equals("Paris", locations[0], "The agent should respond about Paris")
@@ -63,7 +64,7 @@ ERROR: 1 hard assertions failed:
6364

6465

6566
# assert that the agent responded about Paris and only Paris
66-
assert_equals(1, locations.len(),
67+
assert_equals(1, F.len(locations),
6768
"The agent should respond about one location only")
6869

6970
> assert_equals("Paris", locations[0], "The agent should respond about Paris")

0 commit comments

Comments
 (0)