Tornado 6.5 Documentation
RequestHandler): def get(self): self.write("Hello, world") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() asynchronous functions by definition interact differently with their callers; there is no free way to make a synchronous function asynchronous in a way that is transparent to its callers (systems like gevent lightweight threads to offer performance comparable to asynchronous systems, but they do not actually make things asynchronous). Asynchronous operations in Tornado generally return placeholder objects (Futures)0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
self.write("Hello, world") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio asynchronous functions by definition interact differently with their callers; there is no free way to make a synchronousfunction asynchronous in a way that is transparent to its callers (systems like gevent lightweight threads to offer performance comparable to asynchronous systems, but they do not actually make things asynchronous). Asynchronous operations in Tornado generally return placeholder objects (Futures)0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
assert_eq!(result, 4); 222/562Rust 程序设计语言 简体中文版 } #[test] fn another() { panic!("Make this test fail"); } } 示例 11-3:增加第二个因调用了 panic! 而失败的测试 再次 cargo test 运行测试。输出应该看起来像示例 11-4,它表明 failures: ---- tests::another stdout ---- thread 'tests::another' panicked at src/lib.rs:17:9: Make this test fail note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: 了。在单独测试结果和摘要之间多了两个新 的部分:第一个部分显示了测试失败的详细原因。在这个例子中,我们看到 another 因为在 src/lib.rs 的第 10 行 panicked at 'Make this test fail' 而失败的详细信息。下一部分列出 了所有失败的测试,这在有很多测试和很多失败测试的详细输出时很有帮助。我们可以通过使 用失败测试的名称来只运行这个测试,以便调试;下一部分0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1