开发者

assert using unittest outside testcase class

This works:

class TestSequenceFunctions(unittest.TestCase):
      def test_choice(self):
      self.assertEquals(1, 1, 'they are equal!')开发者_运维问答

class OtherClass ( val ):

But I want the assertEquals in the OtherClass class and call it from the TestSequenceFunctions class. But it generates a error: "global name "self" is not defined". Please help ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜