开发者

assert using unittest outside testcase class

开发者 https://www.devze.com 2023-03-28 21:11 出处:网络
This works: class TestSequenceFunctions(unittest.TestCase): def test_choice(self): self.assertEquals(1, 1, \'they are equal!\')开发者_运维问答

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

精彩评论

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