Loading lesson…
Level 1 · Apprentice0 XP
Fixtures, parametrize, fakes for model calls, and snapshot-style checks.
Step 1 / 6
ProblemEvery test run calls the real model API 400 times. The suite takes 6 minutes, costs money, and fails randomly when outputs change slightly.
← → step
Before this: NumPy and pandas in one sitting
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.For a small LLM feature, write unit tests with a fake model (prompt content, output parsing, empty input), one parametrized test, and one @pytest.mark.live test that calls the real API and is skipped unless an environment variable is set.