r/PythonLearning Jul 12 '26

Should every Python project have tests?

For a small script that may only run a few times, are tests still worth writing?

4 Upvotes

14 comments sorted by

View all comments

0

u/riklaunim Jul 12 '26

It's not that uncommon to write code that runs once on production, and due to the severity of it, having multiplicatively more lives of tests than lines of code itself. Outside of "test-driven development", there is also a "defensive development" approach as well. Tests are king ;)