python unittest常用断言

Python单元测试unittest

assertEqual(a, b)     #a == b      
assertNotEqual(a, b)     #a != b      
assertTrue(x)    # bool(x) is True      
assertFalse(x)    # bool(x) is False      
assertIsNone(x)    # x is None     
assertIsNotNone(x)  #   x is not None   
assertIn(a, b)     #a in b    
assertNotIn(a, b)   #  a not in b

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!