Skip to content

Commit

Permalink
Provide assertIsNot for Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Apr 28, 2020
1 parent 8b3c585 commit 690d15b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/build/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def assertNotIn(self, member, container, msg=None):
% (member, container))
def assertIs(self, a, b, msg=None):
return self.assertTrue(a is b, msg or '%s is not %s' % (a, b))
def assertIsNot(self, a, b, msg=None):
return self.assertTrue(a is not b, msg or '%s is %s' % (a, b))
def assertIsInstance(self, obj, cls, msg=None):
return self.assertTrue(isinstance(obj, cls),
msg or '%s is not an instance of %s' % (obj, cls))
Expand Down Expand Up @@ -59,6 +61,7 @@ def assertAlmostEqual(self, first, second, places=None, msg=None,
unittest.TestCase.assertIn = assertIn
unittest.TestCase.assertNotIn = assertNotIn
unittest.TestCase.assertIs = assertIs
unittest.TestCase.assertIsNot = assertIsNot
unittest.TestCase.assertIsInstance = assertIsInstance
unittest.TestCase.assertLess = assertLess
unittest.TestCase.assertGreater = assertGreater
Expand Down

0 comments on commit 690d15b

Please sign in to comment.