Python日记(8)

测试代码 可以通过测试函数 注: 导入了模块unittest和要测试的函数get_formatted_ name()。 你可随 便给这个类命名,但最好让它看起来与要测试的函数相关,并包含字样Test 这个类必须继承 unittest.TestCase类 我们运行test_name_function.py时,所有以test_打头的方法都将自动运行 self.assertEqual(formatted
相关文章
相关标签/搜索