Py学习  »  jesse  »  全部回复
回复总数  1
6 年前
回复了 jesse 创建的主题 » pytest tornado:“simpleAsynchHttpClient”不可iterable

尝试 assert "200" in resp.code assert "OK" in resp.reason 在您的测试\u http_client()函数中。

分配给的对象 resp 是AsynchHttpClient,而不是响应本身。要调用响应消息,您需要 resp.code, resp.reason, resp.body, resp.headers 等。

这是你可以打电话给我的东西的清单 http://www.tornadoweb.org/en/stable/httpclient.html#response-objects