§ 2.10section 10 of 20·~2 min
Common mistakes
- Mutable default fields in dataclasses (use
field(default_factory=list)) - Forgetting
selfas the first method parameter, or forgettingself.when reading an attribute - Tests that depend on each other; each test needs a fresh fixture
- Catching
Exceptionand silently passing - Running
pytestfrom the wrong folder and gettingModuleNotFoundError