python assert assertion methods

assertEqual (a, b, [msg = 'print the test failure information']): assert a and b are equal, are equal by test cases.

assertNotEqual (a, b, [msg = ' print the test failure information']): assert a and b are equal, not equal, then through the test.
assertTrue (x, [msg = 'test fails printed information']): True if x is asserted, then the test is True through.
assertFalse (x, [msg = 'test fails printed information']): assert x is False, False if the test is passed.
assertIs (a, b, [msg = ' test fails printed information']): assert whether a b, then the test is passed.
assertNotIs (a, b, [msg = ' test fails printed information']): assert whether a b, then the test is not passed.
assertIsNone (x, [msg = 'test fails printed information']): x is asserted None, None of the test is passed.
assertIsNotNone (x, [msg = 'test fails printed information']): x is asserted None, None of the test is not passed.
assertIn (a, b, [msg = ' test fails printed information']): b is in the asserted a, b, in the test passed.
assertNotIn (a, b, [msg = ' test fails printed information']): b is in the asserted a, b, the test is not passed.
assertIsInstance (a, b, [msg = ' print the test failure information']): assert a is b is an example, and the test is passed.
assertNotIsInstance (a, b, [msg = ' print the test failure information']): assert a is b is an example, and not by the test.

Guess you like

Origin www.cnblogs.com/YongTing/p/11599392.html