_eq
似乎等于self.assertEqual()
但鼻子里还有一个self.assertNotEqual()
吗?
由于
答案 0 :(得分:4)
Nose没有等效于self.assertNotEqual()
,但您可以通过unittest.TestCase
使用所有nose.tools
断言方法。它们被重命名为全小写并带有下划线。例如:
>>> from nose.tools import assert_not_equal
>>> assert_not_equal(1, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 518, in assertNotEqual
raise self.failureException(msg)
AssertionError: 1 == 1