error_reporter_test.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:stackimpact-python 作者: stackimpact 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号