- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在使用 Python 和 Webtest 来测试一个 WSGI 应用程序。我发现处理程序代码中引发的异常往往会被 Webtest 吞噬,然后引发泛型:
AppError: Bad response: 500 Internal Server Error
我如何告诉它引发或打印导致此问题的原始错误?
最佳答案
虽然 clj 的答案确实有效,但您可能仍希望访问测试用例中的响应。为此,您可以在向 TestApp 发出请求时使用 expect_errors=True
(来自 webtest documentation),这样就不会引发 AppError。这是一个我预计会出现 403 错误的示例:
# attempt to access secure page without logging in
response = testapp.get('/secure_page_url', expect_errors=True)
# now you can assert an expected http code,
# and print the response if the code doesn't match
self.assertEqual(403, response.status_int, msg=str(response))
关于python - 在 Webtest 测试失败中找到真正的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13505778/
我正在使用 VS2017 - 有没有什么方法可以在不安装 VS2017 Enterprise 的情况下让网络测试工作?我只需要 mstest.exe - 而不是 GUI 或 IDE。 最佳答案 不,对
当我尝试使用 webtest 在我的开发服务器上运行 gaeunit 时,出现此错误。 No module named webtest Status: 404 Not Found Conten
我正在使用webtest插件作为grails的功能测试组件。 它可以正常工作,但是非常慢-在测试中,整个应用程序的响应时间很短(每页大于1分钟)。我的感觉是,这是因为当我通过IDE(test-app
在django-webtest ,每个测试 TestCase 子类都带有 self.app,它是 webtest.TestApp 的一个实例,然后我可以通过 self.app.get('/',user
我正在使用 WebTest 测试表单。但是,有些字段是使用 JS 动态创建的,因此这些字段不在 Form 中。当我尝试设置以下字段之一时出现错误: >>> resp.form['new_field']
我有一个 Google App Engine 应用程序,我的请求 hadler 有一个执行身份验证的装饰器。通过 WebTest 我发现 yesterday如何设置登录用户和管理员。 今天我的身份验证
我正在使用 Microsoft WebTest 并希望能够执行类似于 NUnit 的 Assert.Fail() 的操作。我想出的最好办法是 throw new webTestException()
我正在使用 Python 和 Webtest 来测试一个 WSGI 应用程序。我发现处理程序代码中引发的异常往往会被 Webtest 吞噬,然后引发泛型: AppError: Bad response
如果我发送请求,并且我希望响应通过 SignalR 来,是否可以在 Visual Studio 中使用 LoadTest 或 PerformanceTest 进行测试? 最佳答案 简短回答:是的 我已
Azure 上的 Application Insights 允许我上传 .webtest 文件来监控应用程序可用性。我的应用程序是 REST/JSON 服务,因此我的 .webtest 引用从 Ext
我已在此站点中阅读了 Grails 和 Webtest 的文档: http://www.grails.org/plugin/webtest 而且它非常未更新。那里列出的大多数脚本都不起作用。 我正在寻
我无法在Grails 2.3.11上运行webtests。运行grails test-app我得到这个: Error Fatal error running tests: couldn't find
** 更新后 ** 对于 Microsoft Dynamics 环境中的系统和集成测试,我们使用 Visual Studio 2010 Coded UI。我是一个没有经验的 Visual Studio
我为一个看起来运行良好的网站创建了一个网络性能测试。这是一个用于登录和测试导航的简单测试。运行该测试每次都有效。但是当我在 LoadTest 中调用该测试时,问题就出现了。因此,我创建了一个负载测试,
我完全不熟悉使用 Python WebTest 进行功能测试,请多多包涵 我在看 https://webtest.readthedocs.org/en/latest/webtest.html , 所以
我配置了我的 pyramid 应用程序,以便在根据 official tutorial 进行身份验证后将 user 对象附加到 request .到目前为止一切顺利......但是虽然它工作得很好并且
我有一个 .webtest,我打算用它来加载测试将文件上传到网站。我正在使用 Visual Studio 中内置的 WebTest 框架,目的是从 Azure 运行更大规模的测试。 我创建了一个新的网
有谁知道我如何使用 WebTest 测试图像上传。我目前的代码是: form['avatar'] =('avatar', os.path.join(settings.PROJECT_PATH, 'st
我有一个 Azure 资源管理器模板,它是一组嵌套模板的一部分。它创建一个 App Insights 组件、针对禁止请求的网站的警报规则、多步骤 Web 测试以及针对 Web 测试的警报规则。除针对
我有一个 Pyramid 应用程序,它将某些功能锁定为 HTTPS 连接。 服务器前面是 nginx(通常),我使用 PasteDeploy 来检测 HTTPS 连接。从我的环境.ini: [filt
我是一名优秀的程序员,十分优秀!