@@ -71,6 +71,31 @@ def assert_numpy_array_equal(self, np_array, assert_equal):
7171 return
7272 raise AssertionError ('{0} is not equal to {1}.' .format (np_array , assert_equal ))
7373
74+ def assertIs (self , a , b , msg = '' ):
75+ """Checks that 'a' is 'b'"""
76+ assert a is b , "%s: %r is not %r" % (msg .format (a ,b ), a , b )
77+
78+ def assertIsNot (self , a , b , msg = '' ):
79+ """Checks that 'a' is not 'b'"""
80+ assert a is not b , "%s: %r is %r" % (msg .format (a ,b ), a , b )
81+
82+ def assertIsNone (self , a , msg = '' ):
83+ """Checks that 'a' is None"""
84+ self .assertIs (a , None , msg )
85+
86+ def assertIsNotNone (self , a , msg = '' ):
87+ """Checks that 'a' is not None"""
88+ self .assertIsNot (a , None , msg )
89+
90+ def assertIn (self , a , b , msg = '' ):
91+ """Checks that 'a' is in 'b'"""
92+ assert a in b , "%s: %r is not in %r" % (msg .format (a ,b ), a , b )
93+
94+ def assertNotIn (self , a , b , msg = '' ):
95+ """Checks that 'a' is not in 'b'"""
96+ assert a not in b , "%s: %r is in %r" % (msg .format (a ,b ), a , b )
97+
98+
7499# NOTE: don't pass an NDFrame or index to this function - may not handle it
75100# well.
76101assert_almost_equal = _testing .assert_almost_equal
0 commit comments