_eq
似乎等于self.assertEqual()
self.assertNotEqual()
但是鼻子里也有吗?
谢谢
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