Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Made test more robust to implementation details of typed predictor

Thomas D Ahle380c17e2a981
diff --git a/tests/functional/test_functional.py b/tests/functional/test_functional.py
index e85c19f2d..4d77c7e26 100644
--- a/tests/functional/test_functional.py
+++ b/tests/functional/test_functional.py
@@ -220,9 +220,10 @@ def test_bootstrap_effectiveness():
lm.inspect_history(n=2)
# Check that the compiled student has the correct demos
- assert len(compiled_student.output.predictor.predictor.demos) == 1
- assert compiled_student.output.predictor.predictor.demos[0].input == trainset[0].input
- assert compiled_student.output.predictor.predictor.demos[0].output == trainset[0].output
+ demos = compiled_student.predictors()[0].demos
+ assert len(demos) == 1
+ assert demos[0].input == trainset[0].input
+ assert demos[0].output == trainset[0].output
# Test the compiled student's prediction.
# We are using a DummyLM with follow_examples=True, which means that