我正在寫與鼻子的測試套裝,想失敗的情況下,顯示一個類似如何使用鼻子來抑制失敗測試用例的痕跡?
輸出「失敗:is_even(5):甚至沒有」
而不是默認的輸出:
======================================================================
FAIL: seed_db.test_generator(5,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/apurcell/tests/prism/seed_db.py", line 59, in is_even
nose.tools.eq_(x % 2, 0, msg="Not even")
File "/usr/local/lib/python2.7/dist-packages/nose/tools.py", line 31, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: Not even
----------------------------------------------------------------------
有沒有可以做到這一點的鼻子的選項?
有沒有人找到解決方案呢? – user2921139 2014-10-29 23:37:22