コード例 #1
0
 def _assert_return_record(self, return_record, traced_function,
                           expected_logger_name, expected_args, marker):
     self.__assert_trace_record(
         return_record, traced_function, expected_logger_name, "RETURN %r",
         expected_args,
         get_dummy_lineno(
             ("#%s:LN" if has_co_lnotab else "#%s:L1") % marker))
コード例 #2
0
ファイル: functest_traced.py プロジェクト: mzipay/Autologging
 def _assert_return_record(
         self, return_record, traced_function, expected_logger_name,
         expected_args, marker):
     self._assert_trace_record(
         return_record, traced_function, expected_logger_name, "RETURN %r",
         expected_args,
         get_dummy_lineno("#%s:L1" % marker))
コード例 #3
0
ファイル: functest_traced.py プロジェクト: mzipay/Autologging
 def _assert_call_record(
         self, call_record, traced_function, expected_logger_name,
         expected_args, marker):
     self._assert_trace_record(
         call_record, traced_function, expected_logger_name,
         "CALL *%r **%r", expected_args,
         get_dummy_lineno("#%s:L1" % marker))
コード例 #4
0
 def _assert_log_record(self, info_record, logged_function,
                        expected_logger_name, marker):
     expected_message = "%s message" % marker
     self.assertEqual(expected_logger_name, info_record.name)
     self.assertEqual(expected_message, info_record.msg)
     self.assertEqual(tuple(), info_record.args)
     self.assertEqual("INFO", info_record.levelname)
     self.assertEqual(logging.INFO, info_record.levelno)
     # IronPython doesn't handle frames or code objects fully (even with
     # -X:FullFrames)
     if not is_ironpython:
         self.assertEqual(logged_function.__code__.co_filename,
                          info_record.pathname)
         self.assertEqual(get_dummy_lineno(expected_message),
                          info_record.lineno)
         self.assertEqual(logged_function.__name__, info_record.funcName)
コード例 #5
0
ファイル: functest_logged.py プロジェクト: mzipay/Autologging
 def _assert_log_record(
         self, info_record, logged_function, expected_logger_name, marker):
     expected_message = "%s message" % marker
     self.assertEqual(expected_logger_name, info_record.name)
     self.assertEqual(expected_message, info_record.msg)
     self.assertEqual(tuple(), info_record.args)
     self.assertEqual("INFO", info_record.levelname)
     self.assertEqual(logging.INFO, info_record.levelno)
     # IronPython doesn't handle frames or code objects fully (even with
     # -X:FullFrames)
     if not _is_ironpython:
         self.assertEqual(
             logged_function.__code__.co_filename, info_record.pathname)
         self.assertEqual(
             get_dummy_lineno(expected_message), info_record.lineno)
         self.assertEqual(logged_function.__name__, info_record.funcName)
コード例 #6
0
 def _linenumbers(self, marker):
     return (get_dummy_lineno("#%s:L1" % marker),
             get_dummy_lineno("#%s:LY" % marker))
コード例 #7
0
 def _assert_return_record(self, return_record, traced_function,
                           expected_logger_name, expected_args, marker):
     self._assert_trace_record(return_record, traced_function,
                               expected_logger_name, "RETURN %r",
                               expected_args,
                               get_dummy_lineno("#%s:L1" % marker))
コード例 #8
0
 def _assert_call_record(self, call_record, traced_function,
                         expected_logger_name, expected_args, marker):
     self._assert_trace_record(call_record, traced_function,
                               expected_logger_name, "CALL *%r **%r",
                               expected_args,
                               get_dummy_lineno("#%s:L1" % marker))