From: Mike Frysinger Date: Mon, 21 Oct 2013 02:11:05 +0000 (-0400) Subject: tests: support assertIn/assertNotIn in python-2.6 X-Git-Tag: v2.2.8~51 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=44accfe2cacdc72145be1849e937af813d7fc7d3;p=portage.git tests: support assertIn/assertNotIn in python-2.6 --- diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py index 6c5c4dfd5..84e732a1c 100644 --- a/pym/portage/tests/__init__.py +++ b/pym/portage/tests/__init__.py @@ -279,9 +279,16 @@ if unittest_skip_shims: def skipTest(self, reason): raise SkipTest(reason) - setattr(TestCase, 'skipTest', skipTest) + def assertIn(self, member, container, msg=None): + self.assertTrue(member in container, msg=msg) + setattr(TestCase, 'assertIn', assertIn) + + def assertNotIn(self, member, container, msg=None): + self.assertFalse(member in container, msg=msg) + setattr(TestCase, 'assertNotIn', assertNotIn) + class TextTestRunner(unittest.TextTestRunner): """ We subclass unittest.TextTestRunner to output SKIP for tests that fail but are skippable