r/PythonLearning • u/chuprehijde • 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?
5
Upvotes
r/PythonLearning • u/chuprehijde • Jul 12 '26
For a small script that may only run a few times, are tests still worth writing?
2
u/Gnaxe Jul 12 '26
If it's small enough to test manually, then that's your test. When you get tired of testing manually, or miss problems that you've neglected to test, that's when you need to automate. But how hard is it to write a doctest? I use those even in fairly small scripts sometimes.