BIND 10 trac2887, updated. 3b1551b28913ae83e62997de0c8c4dbd28c25217 [2887] catch another possible exception in assertRaises in a python test.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Apr 8 22:34:18 UTC 2013


The branch, trac2887 has been updated
       via  3b1551b28913ae83e62997de0c8c4dbd28c25217 (commit)
      from  23af78de3f2162aa27920e0ccc2784d76e0def8d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b1551b28913ae83e62997de0c8c4dbd28c25217
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Apr 8 15:33:20 2013 -0700

    [2887] catch another possible exception in assertRaises in a python test.
    
    this is another workaround for the binary compatibility issue of FreeBSD 9.1.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/python/tests/rrset_python_test.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/python/tests/rrset_python_test.py b/src/lib/dns/python/tests/rrset_python_test.py
index 010b60c..0ffcdbe 100644
--- a/src/lib/dns/python/tests/rrset_python_test.py
+++ b/src/lib/dns/python/tests/rrset_python_test.py
@@ -78,7 +78,12 @@ class TestModuleSpec(unittest.TestCase):
     def test_add_rdata(self):
         # no iterator to read out yet (TODO: add addition test once implemented)
 
-        self.assertRaises(TypeError, self.rrset_a.add_rdata,
+        # This should result in TypeError, but FreeBSD 9.1 cannot correctly
+        # catch the expected internal C++ exception, resulting in SystemError.
+        # In general it's not a good practice to weaken the test condition for
+        # a limited set of buggy environment, but this seems to be the only
+        # case it could fail this way, so we'd live with it.  See #2887.
+        self.assertRaises((TypeError, SystemError), self.rrset_a.add_rdata,
                           Rdata(RRType("NS"), RRClass("IN"), "test.name."))
 
     def test_to_text(self):



More information about the bind10-changes mailing list