From ef4906c251b39a292c1e411e7b72d270768949c0 Mon Sep 17 00:00:00 2001
From: Pieter van Oostrum <pieter@vanoostrum.org>
Date: Tue, 31 Dec 2019 21:49:58 +0100
Subject: [PATCH 1/1] Updated python/tests/tstLastError.py

libxml2.registerErrorHandler(None,None):
None is not acceptable as first argument
failUnlessEqual replaced by assertEqual
---
 python/tests/tstLastError.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py
index 81d0acc4..1758a9fb 100755
--- a/python/tests/tstLastError.py
+++ b/python/tests/tstLastError.py
@@ -25,7 +25,10 @@ class TestCase(unittest.TestCase):
         when the exception is raised, check the libxml2.lastError for
         expected values."""
         # disable the default error handler
-        libxml2.registerErrorHandler(None,None)
+        def noerr(ctx, str):
+            pass
+        # None is not acceptable as function.
+        libxml2.registerErrorHandler(noerr,None)
         try:
             f(*args)
         except exc:
@@ -40,12 +43,12 @@ class TestCase(unittest.TestCase):
                 print("file =",e.file())
                 print("line =",e.line())
                 print()
-            self.failUnlessEqual(domain,e.domain())
-            self.failUnlessEqual(code,e.code())
-            self.failUnlessEqual(message,e.message())
-            self.failUnlessEqual(level,e.level())
-            self.failUnlessEqual(file,e.file())
-            self.failUnlessEqual(line,e.line())
+            self.assertEqual(domain,e.domain())
+            self.assertEqual(code,e.code())
+            self.assertEqual(message,e.message())
+            self.assertEqual(level,e.level())
+            self.assertEqual(file,e.file())
+            self.assertEqual(line,e.line())
         else:
             self.fail("exception %s should have been raised" % exc)
 
-- 
2.19.1

