fix assertIsNotNone py< 2.7 implementation

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset34363df41323
branchdefault
phasepublic
hiddenno
parent revision#bf74411c45cb [modutils] don't propagate IOError when package's __init__.py file doesn't exist. Closes #174606
child revision#07d7716808ae [jsonunittest] add a new jsonunittest module to make unittest produce JSON data (closes #184774), #f78e3c4d5d79 [jsonunittest] add a new jsonunittest module to make unittest produce JSON data, #b488b5bd0277 [modutils] ensure file is closed, may cause pb depending on the interpreter (eg pypy). Closes #180876, #e9fc9f452231 merge default heads
files modified by this revision
testlib.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1380869872 -7200
# Fri Oct 04 08:57:52 2013 +0200
# Node ID 34363df4132345f7bcc41526a2956f9a6487a909
# Parent bf74411c45cb4c20fc40953ba67e897438fb1839
fix assertIsNotNone py< 2.7 implementation

diff --git a/testlib.py b/testlib.py
@@ -1187,11 +1187,11 @@
1          assertItemsEqual = unittest.TestCase.assertCountEqual
2      else:
3          assertCountEqual = unittest.TestCase.assertItemsEqual
4          if sys.version_info < (2,7):
5              def assertIsNotNone(self, value, *args, **kwargs):
6 -                self.assertEqual(None, value, *args, **kwargs)
7 +                self.assertNotEqual(None, value, *args, **kwargs)
8 
9  TestCase.assertItemsEqual = deprecated('assertItemsEqual is deprecated, use assertCountEqual')(
10      TestCase.assertItemsEqual)
11 
12  import doctest