# 返回值是否相等 self.assertEqual(a, b) # 判断 a == b self.assertNotEqual(a, b) # 判断 a != b # 返回值是布尔值 self.assertTrue(x) # 判断布尔值 bool(x) is True self.assertFalse(x) # 判断布尔值 bool(x) is False # 返回值是否为空 self.assertIsNone(x) # 判断是否为空 x is None self.assertIsNotNone(x) # 判断是否为空 x is not None # 返回值是否包含某值 self.assertIn(a, b) # 判断a在b里面 a in b self.assertNotIn(a, b) # 判断a不在b里面 a not in b