def test_add_exception(self):
stackimpact._agent = None
agent = stackimpact.start(
dashboard_address = 'http://localhost:5001',
agent_key = 'key1',
app_name = 'TestPythonApp',
debug = True
)
agent.error_reporter.start()
try:
raise ValueError('test_exc_1')
except:
traceback.print_exc()
time.sleep(1.1)
profile_handled_exc = agent.error_reporter.profile
#print(profile_handled_exc)
self.assertTrue('ValueError: test_exc_1' in str(profile_handled_exc))
self.assertTrue('test_add_exception' in str(profile_handled_exc))
agent.destroy()
error_reporter_test.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录