Parcourir la source

[trac955] added some descriptive comments to __match_exception()

JINMEI Tatuya il y a 14 ans
Parent
commit
99785047d7
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      src/bin/xfrin/tests/xfrin_test.py

+ 4 - 0
src/bin/xfrin/tests/xfrin_test.py

@@ -209,6 +209,10 @@ class TestXfrinConnection(unittest.TestCase):
         return mock_ctx
 
     def __match_exception(self, expected_exception, expected_msg, expression):
+        # This helper method is a higher-granularity version of assertRaises().
+        # If it's not sufficient to check the exception class (e.g., when
+        # the same type of exceptions can be thrown from many places), this
+        # method can be used to check it with the exception argument.
         try:
             expression()
         except expected_exception as ex: