Tornado 6.5 Documentation
Authors May 22, 2025CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . . . . . . concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 6.6 Integration with other services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . code. 7Tornado Documentation, Release 6.5.1 8 Chapter 3. Threads and WSGICHAPTER FOUR ASYNCIO INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
Tornado objects. run_in_executor is the recommended way to interact with blocking code. asyncio Integration Tornado is integrated with the standard library asyncio [https://docs.python.org/3/library/asyncio primitives tornado.queues – Queues for coroutines tornado.process — Utilities for multiple processes Integration with other services tornado.auth — Third-party login with OpenID and OAuth tornado.wsgi — Interoperability or yield so that any exceptions have somewhere to go. Decorated coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
测试的组织结构 本章一开始就提到,测试是一个复杂的概念,而且不同的开发者也采用不同的术语和组织。 Rust 社区倾向于根据测试的两个主要分类来考虑问题:单元测试(unit tests)与集成测试 (integration tests)。单元测试倾向于更小而更集中,在隔离的环境中一次测试一个模块,并且 可以测试私有接口。而集成测试对于你的库来说则完全是外部的。它们与其他外部代码一样, 通过相同的方式使用你的代 的代码。创建一个 tests 目录,新建 一个文件 tests/integration_test.rs。目录结构应该看起来像这样: adder ├── Cargo.lock ├── Cargo.toml 244/562Rust 程序设计语言 简体中文版 ├── src │ └── lib.rs └── tests └── integration_test.rs 将示例 11-13 中的代码输入到 中的代码输入到 tests/integration_test.rs 文件中。 文件名:tests/integration_test.rs use adder::add_two; #[test] fn it_adds_two() { let result = add_two(2); assert_eq!(result, 4); } 示例 11-13:一个 adder crate 中函数的集成测试0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1