08 2013 档案
摘要:起因:在运行下面的unittest过程中出现了个Traceback:被测试脚本:# splitter.pydef split(line, types=None, delimiter=None): """Splits a line of test and optionally performs type conversion. For example: >>> split('GOOD 100 490.50') ['GOOD', '100', '490.50'] >>>
阅读全文
摘要:实际上unittest模块才是真正意义上的用于测试的模块,功能强大的单元测试模块。继续使用前面的例子:# splitter.pydef split(line, types=None, delimiter=None): """Splits a line of test and optionally performs type conversion. For example: >>> split('GOOD 100 490.50') ['GOOD', '100', '490.50'] &
阅读全文
摘要:doctest是属于测试模块里的一种,对注释文档里的示例进行检测。给出一个例子:splitter.pydef split(line, types=None, delimiter=None): """Splits a line of test and optionally performs type conversion. For example: >>> split('GOOD 100 490.50') ['GOOD', '100', '490.50'] >>> s
阅读全文