本文整理汇总了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',
)
示例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')
示例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')
示例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"')
示例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"')