鼻子测试并找出所有可能的库函数
Nosetests and finding out all possible library functions
我最近重新开始 python 我有点生疏了。我已经开始使用测试框架 nose。我正在尝试找出可用于此框架的可能功能。
例如,当我在 ruby 中使用 rspec 时,如果我想找出 "options" 我在编写测试用例时可用的内容,我只需转到 link 并浏览 doco,直到找到我需要的内容:
https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/comparison-matchers
现在,当我尝试对鼻子做同样的事情时,Google 一直把我送到:
https://nose.readthedocs.io/en/latest/writing_tests.html#test-functions
虽然 doco 提供了丰富的信息,但这并不是我真正想要的。
是否有 python 命令可用于查找可能的测试选项或存储最新文档的其他位置?
nose/unittests 提供的所有断言都应记录在案:
https://docs.python.org/2.7/library/unittest.html
除了doc,代码总会说实话。您可以查看库源代码,或放入测试方法中的调试器:
import pdb; pdb.set_trace()
然后检查可用断言的测试方法。
dir(self)
help(unittest.skip)
我最近重新开始 python 我有点生疏了。我已经开始使用测试框架 nose。我正在尝试找出可用于此框架的可能功能。
例如,当我在 ruby 中使用 rspec 时,如果我想找出 "options" 我在编写测试用例时可用的内容,我只需转到 link 并浏览 doco,直到找到我需要的内容:
https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/comparison-matchers
现在,当我尝试对鼻子做同样的事情时,Google 一直把我送到:
https://nose.readthedocs.io/en/latest/writing_tests.html#test-functions
虽然 doco 提供了丰富的信息,但这并不是我真正想要的。
是否有 python 命令可用于查找可能的测试选项或存储最新文档的其他位置?
nose/unittests 提供的所有断言都应记录在案:
https://docs.python.org/2.7/library/unittest.html
除了doc,代码总会说实话。您可以查看库源代码,或放入测试方法中的调试器:
import pdb; pdb.set_trace()
然后检查可用断言的测试方法。
dir(self)
help(unittest.skip)