Reference – http://docs.python.org/library/unittest.html#assert-methods
assertEqual(a, b) # checks that a == b
assertIs(a, b) # checks that a is b <---- whatever that means????
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using
assertEqualthe two objects need not be of the same type, they merely need to be the same value. In comparison, usingassertIsthe two objects need to be the same object.assertEqualtests for equality like the==operator:assertIstest for object identity same as theisandis notoperators:The above quotes both come from the Python documentation section 5.9 Comparisons.