- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 760 for asyncio (0.33 sec)
-
docs/zh/docs/advanced/async-tests.md
您已经了解了如何使用 `TestClient` 测试 **FastAPI** 应用程序。但是到目前为止,您只了解了如何编写同步测试,而没有使用 `async` 异步函数。 在测试中能够使用异步函数可能会很有用,比如当您需要异步查询数据库的时候。想象一下,您想要测试向 FastAPI 应用程序发送请求,然后验证您的后端是否成功在数据库中写入了正确的数据,与此同时您使用了异步的数据库的库。 让我们看看如何才能实现这一点。 ## pytest.mark.anyio 如果我们想在测试中调用异步函数,那么我们的测试函数必须是异步的。 AnyIO 为此提供了一个简洁的插件,它允许我们指定一些测试函数要异步调用。 ## HTTPX 即使您的 **FastAPI** 应用程序使用普通的 `def` 函数而不是 `async def` ,它本质上仍是一个 `async` 异步应用程序。
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 17 21:49:06 UTC 2024 - 3.9K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/ServerMessageBlock2RequestTest.java
@Test @DisplayName("createCancel should return Smb2CancelRequest with same mid and asyncId") void testCreateCancel() { long mid = 123L; long asyncId = 456L; testRequest.setMid(mid); testRequest.setAsyncId(asyncId); CommonServerMessageBlockRequest cancelRequest = testRequest.createCancel();Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.7K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/Smb2CancelRequestTest.java
assertEquals(asyncId, request.getAsyncId()); assertTrue((request.getFlags() & SMB2_FLAGS_ASYNC_COMMAND) != 0, "Async flag should be set when asyncId is non-zero"); } @Test @DisplayName("Test constructor with zero asyncId does not set async flag") void testConstructorWithZeroAsyncId() { // Given long mid = 12345L; long asyncId = 0L; // When
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.8K bytes - Viewed (0) -
src/main/java/jcifs/internal/smb2/ServerMessageBlock2.java
* * @return the asyncId */ public final long getAsyncId() { return this.asyncId; } /** * Sets the asynchronous identifier for this message. * * @param asyncId * the asyncId to set */ public final void setAsyncId(final long asyncId) { this.asyncId = asyncId; } /**Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sun Aug 31 08:00:57 UTC 2025 - 24K bytes - Viewed (0) -
src/main/java/jcifs/internal/smb2/Smb2CancelRequest.java
* The message ID of the request to cancel * @param asyncId * The async ID for asynchronous operations (0 for synchronous) */ public Smb2CancelRequest(final Configuration config, final long mid, final long asyncId) { super(config, SMB2_CANCEL); setMid(mid); setAsyncId(asyncId); if (asyncId != 0) { addFlags(SMB2_FLAGS_ASYNC_COMMAND); } }Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 4.5K bytes - Viewed (0) -
docs/en/docs/release-notes.md
* Fix typos in Async docs. PR [#1423](https://github.com/tiangolo/fastapi/pull/1423). ## 0.54.2 * Add translation to Spanish for [Concurrency and async / await - Concurrencia y async / await](https://fastapi.tiangolo.com/es/async/). PR [#1290](https://github.com/tiangolo/fastapi/pull/1290) by [@alvaropernas](https://github.com/alvaropernas).
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 19:06:15 UTC 2025 - 586.7K bytes - Viewed (0) -
tests/test_dependency_class.py
@app.get("/callable-gen-dependency") async def get_callable_gen_dependency(value: str = Depends(callable_gen_dependency)): return value @app.get("/async-callable-dependency") async def get_async_callable_dependency( value: str = Depends(async_callable_dependency), ): return value @app.get("/async-callable-gen-dependency") async def get_async_callable_gen_dependency( value: str = Depends(async_callable_gen_dependency), ):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 4.4K bytes - Viewed (0) -
tests/benchmarks/test_general_performance.py
@app.get("/async/large-dict-no-response-model") async def async_large_dict_no_response_model(): return LARGE_PAYLOAD @app.get("/async/large-dict-with-response-model", response_model=LargeOut) async def async_large_dict_with_response_model(): return LARGE_PAYLOAD @app.get("/async/large-model-no-response-model") async def async_large_model_no_response_model():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 20:40:26 UTC 2025 - 11.1K bytes - Viewed (0) -
tests/test_dependency_partial.py
return value @app.get("/partial-async-callable-dependency") async def get_partial_async_callable_dependency( value: Annotated[ str, Depends( partial(async_callable_dependency, "partial-async-callable-dependency") ), ], ) -> str: return value @app.get("/partial-async-callable-gen-dependency") async def get_partial_async_callable_gen_dependency(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java
async.setFuture(inner); async.cancel(false); assertTrue(inner.isCancelled()); assertFalse(inner.wasInterrupted()); assertThrows(CancellationException.class, () -> inner.get()); } public void testCancel_beforeSet() throws Exception { SettableFuture<Object> async = SettableFuture.create(); async.cancel(true); assertFalse(async.set(42)); }
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Sep 22 17:49:12 UTC 2025 - 7.3K bytes - Viewed (0)