mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-03-03 07:45:45 +03:00
Silence warnings due to deprecated TestCase methods
With a veiled criticism.
This commit is contained in:
parent
ac5cde8834
commit
43c8fce45c
|
@ -41,6 +41,16 @@ else:
|
|||
|
||||
unittest.TestCase.skipTest = skipTest
|
||||
|
||||
# Silence warnings caused by the stubborness of the Python unittest maintainers
|
||||
# http://bugs.python.org/issue9424
|
||||
if not hasattr(unittest.TestCase, 'assert_') \
|
||||
or unittest.TestCase.assert_ is not unittest.TestCase.assertTrue:
|
||||
# mavaff...
|
||||
unittest.TestCase.assert_ = unittest.TestCase.assertTrue
|
||||
unittest.TestCase.failUnless = unittest.TestCase.assertTrue
|
||||
unittest.TestCase.assertEquals = unittest.TestCase.assertEqual
|
||||
unittest.TestCase.failUnlessEqual = unittest.TestCase.assertEqual
|
||||
|
||||
|
||||
def decorate_all_tests(cls, decorator):
|
||||
"""Apply *decorator* to all the tests defined in the TestCase *cls*."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user