Advertisement
spacelawyerscott

unittest

Dec 11th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Python Unit Testing
  2. Unit testing in python allows you to test your code more efficiently, and automatically
  3.  
  4. Rather than coding a script or function, and running it over and over again to test out different results,
  5. you can code a unittest function, that will test your code for you with different inputs that you provide,
  6. and tell you if any errors occured or if it executed without hiccups.
  7. You can simply test if it will run successfully, or you can test if it will output an expected result.
  8. Using unit testing allows you to test your code as you code, which can help you find errors early on rather than
  9. when you need it to work.
  10.  
  11. You can use assertEqual to look for a certain result, and you can use assertTrue and assertFalse to test for
  12. boolean results.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement