当前位置: 首页>>代码示例>>Python>>正文


Python Stacktrace.get_stacktrace方法代码示例

本文整理汇总了Python中sentry.interfaces.Stacktrace.get_stacktrace方法的典型用法代码示例。如果您正苦于以下问题:Python Stacktrace.get_stacktrace方法的具体用法?Python Stacktrace.get_stacktrace怎么用?Python Stacktrace.get_stacktrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sentry.interfaces.Stacktrace的用法示例。


在下文中一共展示了Stacktrace.get_stacktrace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_stacktrace_with_filename_function_lineno_and_context

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_stacktrace [as 别名]
 def test_get_stacktrace_with_filename_function_lineno_and_context(self):
     event = mock.Mock(spec=Event())
     interface = Stacktrace(
         frames=[
             {"filename": "foo", "function": "biz", "lineno": 3, "context_line": "  def foo(r):"},
             {"filename": "bar", "function": "baz", "lineno": 5, "context_line": "    return None"},
         ]
     )
     result = interface.get_stacktrace(event)
     self.assertEquals(
         result,
         'Stacktrace (most recent call last):\n\n  File "foo", line 3, in biz\n    def foo(r):\n  File "bar", line 5, in baz\n    return None',
     )
开发者ID:CaseCommonsDevOps,项目名称:sentry,代码行数:15,代码来源:tests.py

示例2: test_get_stacktrace_with_filename_function_lineno_and_context

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_stacktrace [as 别名]
 def test_get_stacktrace_with_filename_function_lineno_and_context(self):
     event = mock.Mock(spec=Event())
     interface = Stacktrace(frames=[{'filename': 'foo', 'function': 'biz', 'lineno': 3, 'context_line': '  def foo(r):'},
         {'filename': 'bar', 'function': 'baz', 'lineno': 5, 'context_line': '    return None'}])
     result = interface.get_stacktrace(event)
     self.assertEquals(result, 'Stacktrace (most recent call last):\n\n  File "foo", line 3, in biz\n    def foo(r):\n  File "bar", line 5, in baz\n    return None')
开发者ID:Supy,项目名称:sentry,代码行数:8,代码来源:tests.py

示例3: test_get_stacktrace_with_filename_and_function

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_stacktrace [as 别名]
 def test_get_stacktrace_with_filename_and_function(self):
     event = mock.Mock(spec=Event())
     interface = Stacktrace(frames=[{'filename': 'foo', 'function': 'biz'}, {'filename': 'bar', 'function': 'baz'}])
     result = interface.get_stacktrace(event)
     self.assertEquals(result, 'Stacktrace (most recent call last):\n\n  File "foo", in biz\n  File "bar", in baz')
开发者ID:Supy,项目名称:sentry,代码行数:7,代码来源:tests.py

示例4: test_get_stacktrace_with_only_filename

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_stacktrace [as 别名]
 def test_get_stacktrace_with_only_filename(self):
     event = mock.Mock(spec=Event())
     interface = Stacktrace(frames=[{'filename': 'foo'}, {'filename': 'bar'}])
     result = interface.get_stacktrace(event)
     self.assertEquals(result, 'Stacktrace (most recent call last):\n\n  File "foo"\n  File "bar"')
开发者ID:Supy,项目名称:sentry,代码行数:7,代码来源:tests.py

示例5: test_get_stacktrace_with_module

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_stacktrace [as 别名]
 def test_get_stacktrace_with_module(self):
     event = mock.Mock(spec=Event())
     interface = Stacktrace(frames=[{"module": "foo"}, {"module": "bar"}])
     result = interface.get_stacktrace(event)
     self.assertEquals(result, 'Stacktrace (most recent call last):\n\n  Module "foo"\n  Module "bar"')
开发者ID:CaseCommonsDevOps,项目名称:sentry,代码行数:7,代码来源:tests.py


注:本文中的sentry.interfaces.Stacktrace.get_stacktrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。