我正在写与鼻子的测试套装,想失败的情况下,显示一个类似如何使用鼻子来抑制失败测试用例的痕迹?
输出“失败: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