Is there a shortcut for self.assertNotEqual () in the nose?

_eq seems equal to self.assertEqual()

But is there also self.assertNotEqual() in the nose?

thanks

+6
source share
1 answer

The nose does not have the equivalent of self.assertNotEqual() , but you can use all unittest.TestCase assert methods through nose.tools . They are renamed to all lowercase letters and with underscores. For instance:

 >>> 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 

More info here

+4
source

Source: https://habr.com/ru/post/955926/


All Articles