Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 68 for TestClient (0.27 sec)

  1. docs/en/docs/reference/testclient.md

    You can use the `TestClient` class to test FastAPI applications without creating an actual HTTP and socket connection, just communicating directly with the FastAPI code.
    
    Read more about it in the [FastAPI docs for Testing](https://fastapi.tiangolo.com/tutorial/testing/).
    
    You can import it directly from `fastapi.testclient`:
    
    ```python
    from fastapi.testclient import TestClient
    ```
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 450 bytes
    - Viewed (0)
  2. docs/ja/docs/tutorial/testing.md

    <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a> がベースなので、非常に使いやすく直感的です。
    
    これを使用すると、**FastAPI** と共に <a href="https://docs.pytest.org/" class="external-link" target="_blank">pytest</a> を直接利用できます。
    
    ## `TestClient` を使用
    
    `TestClient` をインポートします。
    
    `TestClient` を作成し、**FastAPI** に渡します。
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. docs/ru/docs/advanced/async-tests.md

    Чтобы работать с асинхронным FastAPI приложением в ваших обычных тестовых функциях `def`, используя стандартный pytest, `TestClient` внутри себя делает некоторую магию. Но эта магия перестает работать, когда мы используем его внутри асинхронных функций. Запуская наши тесты асинхронно, мы больше не можем использовать `TestClient` внутри наших тестовых функций.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Jan 27 15:36:13 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  4. fess-crawler/src/test/java/org/codelibs/fess/crawler/client/FaultTolerantClientTest.java

            assertEquals(2, testClient.count);
        }
    
        public void test_doGet_with4Exception_interval100() {
            final FaultTolerantClient client = new FaultTolerantClient();
            client.setRetryInterval(100);
            final TestClient testClient = new TestClient();
            testClient.exceptionCount = 4;
            testClient.interval = 100;
    Registered: Sun Sep 21 03:50:09 UTC 2025
    - Last Modified: Sat Mar 15 06:52:00 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  5. docs/es/docs/advanced/testing-websockets.md

    # Probando WebSockets
    
    Puedes usar el mismo `TestClient` para probar WebSockets.
    
    Para esto, usas el `TestClient` en un statement `with`, conectándote al WebSocket:
    
    {* ../../docs_src/app_testing/tutorial002.py hl[27:31] *}
    
    /// note | Nota
    
    Para más detalles, revisa la documentación de Starlette sobre <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">probando sesiones WebSocket</a>.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Dec 30 18:26:57 UTC 2024
    - 457 bytes
    - Viewed (0)
  6. docs/pt/docs/tutorial/testing.md

    Isso permite que você use `pytest` diretamente sem complicações.
    
    ///
    
    /// note | Detalhes técnicos
    
    Você também pode usar `from starlette.testclient import TestClient`.
    
    **FastAPI** fornece o mesmo `starlette.testclient` que `fastapi.testclient` apenas como uma conveniência para você, o desenvolvedor. Mas ele vem diretamente da Starlette.
    
    ///
    
    /// tip | Dica
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/testing-events.md

    {* ../../docs_src/app_testing/tutorial004.py hl[9:15,18,27:28,30:32,41:43] *}
    
    
    You can read more details about the ["Running lifespan in tests in the official Starlette documentation site."](https://www.starlette.io/lifespan/#running-lifespan-in-tests)
    
    For the deprecated `startup` and `shutdown` events, you can use the `TestClient` as follows:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:29:21 UTC 2025
    - 615 bytes
    - Viewed (0)
  8. docs/ko/docs/tutorial/testing.md

    그리고 클라이언트에 대한 호출도 `await` 를 사용하지 않는 일반 호출입니다.
    
    이렇게 하여 복잡한 과정 없이 `pytest` 를 직접적으로 사용할 수 있습니다.
    
    ///
    
    /// note | 기술 세부사항
    
    `from starlette.testclient import TestClient` 역시 사용할 수 있습니다.
    
    **FastAPI** 는 개발자의 편의를 위해 `starlette.testclient` 를 `fastapi.testclient` 로도 제공할 뿐입니다. 이는 단지 `Starlette` 에서 직접 가져오는지의 차이일 뿐입니다.
    
    ///
    
    /// tip | 팁
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Tue Dec 10 11:24:48 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  9. docs/pt/docs/advanced/async-tests.md

    O `TestClient` faz algumas mágicas para invocar a aplicação FastAPI assíncrona em suas funções `def` normais, utilizando o pytest padrão. Porém a mágica não acontece mais quando nós estamos utilizando dentro de funções assíncronas. Ao executar os nossos testes de forma assíncrona, nós não podemos mais utilizar o `TestClient` dentro das nossas funções de teste.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  10. docs/es/docs/advanced/async-tests.md

    El `TestClient` hace algo de magia interna para llamar a la aplicación FastAPI asíncrona en tus funciones de test `def` normales, usando pytest estándar. Pero esa magia ya no funciona cuando lo usamos dentro de funciones asíncronas. Al ejecutar nuestros tests de manera asíncrona, ya no podemos usar el `TestClient` dentro de nuestras funciones de test.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Dec 30 18:26:57 UTC 2024
    - 4K bytes
    - Viewed (0)
Back to top