021第11章 TESTING YOUR CODE_續3_Assert 方法
💛20230121晨讀感言:
💔寫個 測試 function 和 寫個 測試 class 的程式,其過程很類似,而我為什麼要學這個,我想 最主要的原因是: 當你 想改變 程式又不會想 破壞 之前已完成 的程式 所展現的功能時,那麼,經由 寫個 測試 程式,是最保險 的 修改程式 的方法。
💔今天是農曆除夕,等一下要開車從高雄北上去台北過年去了,期待高速公路上不會塞車太嚴重。
💛晨讀摘要:
💚216 A Variety of Assert Methods:Python provides a number of assert methods in the unittest.TestCase class.
💚217 With these Assert methods you can verify that returned values equal or don’t equal expected values, that values are True or False, and that values are in or not in a given list. You can use these methods only in a class that inherits from unittest .TestCase, so let’s look at how we can use one of these methods in the context of testing an actual class.
from :《python crash course》
Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!
- Author
- More