Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.
Start 7-day trial →
⚡
← Courses
›
Senior Deep-Dives
›
Module 4 · Memory + profiling · Recap
›
Mocking: when it lies to you
quiz
90 / 161
🇺🇸
EN
▼
↗
Share
⋯
More
+100 XP
📋
Task
📖
Theory
🤖
AI Help
Task
📝 **Question:** Mocking what is usually a mistake? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Quiz
Question
📝 **Question:** Mocking what is usually a mistake? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
The system clock — `freezegun` makes time-dependent tests deterministic and is non-negotiable for billing logic.
B
Your own DB layer — mock-DB passes while real-DB breaks the migration. Use a real container DB in tests.
C
External APIs — vendor SDKs change every quarter so a frozen stub diverges quickly from the live contract.
D
The filesystem — `pyfakefs` swaps `open()` so tests run faster and never leave temp dirs behind on CI runners.
Submit answer
💬 Discussion
Be the first to ask a question or share a tip.
Sign in
to join the discussion. Reading is free.
Loading discussion…