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))
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))
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))
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)
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)
def _linenumbers(self, marker): return (get_dummy_lineno("#%s:L1" % marker), get_dummy_lineno("#%s:LY" % marker))
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))
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))