Question

_eq seems to be the equal to self.assertEqual()

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

Thanks

Was it helpful?

Solution

Nose doesn't have an equivalent to self.assertNotEqual(), but you can use all of the unittest.TestCase assert methods via nose.tools. They are renamed to all-lowercase and with underscores. For example:

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top