Simon Willison 1/27/2026

Tips for getting coding agents to write good Python tests

Read Original

The article provides practical advice for prompting AI coding agents to write better Python tests. It emphasizes the importance of working within a project that already has a good test suite, using specific libraries like pytest-httpx, and refactoring common anti-patterns like duplicated setup code. The author suggests directing agents to study existing codebases as examples to imitate preferred testing patterns.

Tips for getting coding agents to write good Python tests

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week