2013-10-14 7 views

答えて

4

鼻はself.assertNotEqual()に相当するものがありませんが、nose.tools経由unittest.TestCaseアサートメソッドのすべてを使用することができます。名前はすべて小文字とアンダースコアに変更されています。たとえば、次のように

>>> 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 
のPythonのバージョンを使用している

More info here.

+1

どのように彼らはそれを逃すことができますか? :)ありがとう – Houman

+0

これを試してみてください: 'from nose.tools import assert_not_equal as neq_' – jdhildeb

関連する問題