Unit tests Recommended
Keep unit tests fast
Each unit test runs in milliseconds, and the whole unit suite runs in seconds.
How to do it
Keep unit tests free of disks, databases, networks and sleeps. Watch the slowest tests with the runner's report, such as pytest --durations=10 or Vitest's slowTestThreshold option. Move a slow test to the integration suite, or remove what makes it slow.
Example
pytest tests/unit --durations=10
How to check
The slowest unit test takes under 100 milliseconds. The unit suite runs in under 30 seconds.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/unit-tests/fast-unit-tests.