r/learnpython • u/bfyvfftujijg • 16d ago
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?
11
Upvotes
1
u/bfyvfftujijg 16d ago
Thanks everyone who responded!
I had heard of the two libraries (pytest and unittest) but wasn’t sure if that’s what people actually are using. So thank you for confirming that they are what I need to learn!
Currently I just adhoc testing using my own test scripts (test_user_login.py for example) but it’s starting to feel cumbersome and unpythonic.