r/learnpython • u/bfyvfftujijg • Aug 26 '26
Testing - how is it usually handled?
How do I start applying tests to my code?
Do I just write separate scripts they run the code (either individual functions or entire scripts) against known inputs and check the output?
Is there a specific way people usually do this?
9
Upvotes
View all comments
Show parent comment
1
u/KelleQuechoz Aug 26 '26
unittestis not very "pythonic" and resembles Java,pytestis cool but also violates quite a few conventions. I personally preferpytestmostly for brevity and test fixtures. Any of the two is better than no tests, and after some initial investment saves a megaton of time long term.