继承自nose.case.Test的测试样例类的测试方法无法被nosetests执行是怎么回事?

import nose.case
from nose.tools import assert_equal

class TestTest(nose.case.Test):

    def test_hehe(self):
        assert_equal(1, 1)

    pass

就是这样的代码,用nosetests test.py命令执行居然是这样的结果
clipboard.png

而如果继承自unittest.TestCase就没有这个问题。为什么?

阅读 4k
1 个回答

官方文档这样说滴:

A test class is a class defined in a test module that matches testMatch or is a subclass of unittest.TestCase. 
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题