From 44accfe2cacdc72145be1849e937af813d7fc7d3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 20 Oct 2013 22:11:05 -0400 Subject: [PATCH] tests: support assertIn/assertNotIn in python-2.6 --- pym/portage/tests/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.26.2