Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 41 - 50 of 1,189 for BytesX (0.08 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. tests/test_invalid_sequence_param.py

    import pytest
    from fastapi import FastAPI, Query
    from pydantic import BaseModel
    
    
    def test_invalid_sequence():
        with pytest.raises(
            AssertionError,
            match="Query parameter 'q' must be one of the supported types",
        ):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: list[Item] = Query(default=None)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  2. tests/test_dependency_contextmanager.py

        assert state["/async_raise"] == "asyncgen raise not started"
        with pytest.raises(OtherDependencyError):
            client.get("/async_raise_other")
        assert state["/async_raise"] == "asyncgen raise finalized"
        assert "/async_raise" not in errors
    
    
    def test_sync_raise_other():
        assert state["/sync_raise"] == "generator raise not started"
        with pytest.raises(OtherDependencyError):
            client.get("/sync_raise_other")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 11.5K bytes
    - Click Count (0)
  3. docs/zh-hant/docs/tutorial/testing.md

    建立一個 `TestClient`,把你的 **FastAPI** 應用傳入其中。
    
    建立名稱以 `test_` 開頭的函式(這是 `pytest` 的慣例)。
    
    像使用 `httpx` 一樣使用 `TestClient` 物件。
    
    用簡單的 `assert` 敘述搭配標準的 Python 運算式來檢查(同樣是 `pytest` 的標準用法)。
    
    {* ../../docs_src/app_testing/tutorial001_py310.py hl[2,12,15:18] *}
    
    /// tip
    
    注意測試函式是一般的 `def`,不是 `async def`。
    
    而且對 client 的呼叫也都是一般呼叫,不需要使用 `await`。
    
    這讓你可以直接使用 `pytest`,不必費心處理非同步。
    
    ///
    
    /// note | 技術細節
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 5.6K bytes
    - Click Count (0)
  4. docs/zh/docs/tutorial/testing.md

    通过传入你的**FastAPI**应用创建一个 `TestClient` 。
    
    创建名字以 `test_` 开头的函数(这是标准的 `pytest` 约定)。
    
    像使用 `httpx` 那样使用 `TestClient` 对象。
    
    为你需要检查的地方用标准的Python表达式写个简单的 `assert` 语句(重申,标准的`pytest`)。
    
    {* ../../docs_src/app_testing/tutorial001_py310.py hl[2,12,15:18] *}
    
    /// tip | 提示
    
    注意测试函数是普通的 `def`,不是 `async def`。
    
    还有client的调用也是普通的调用,不是用 `await`。
    
    这让你可以直接使用 `pytest` 而不会遇到麻烦。
    
    ///
    
    /// note | 技术细节
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  5. docs/uk/docs/advanced/async-tests.md

    ## Запуск { #run-it }
    
    Ви можете запустити тести як зазвичай:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ---> 100%
    ```
    
    </div>
    
    ## Докладно { #in-detail }
    
    Маркер `@pytest.mark.anyio` повідомляє pytest, що цю тестову функцію слід викликати асинхронно:
    
    {* ../../docs_src/async_tests/app_a_py310/test_main.py hl[7] *}
    
    /// tip | Порада
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 5.9K bytes
    - Click Count (0)
  6. tests/test_tutorial/test_body_multiple_params/test_tutorial001.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial001_py310", marks=needs_py310),
            pytest.param("tutorial001_an_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 6.9K bytes
    - Click Count (0)
  7. docs/pt/docs/tutorial/testing.md

    Ele é baseado no [HTTPX](https://www.python-httpx.org), que por sua vez é projetado com base em Requests, por isso é muito familiar e intuitivo.
    
    Com ele, você pode usar o [pytest](https://docs.pytest.org/) diretamente com **FastAPI**.
    
    ## Usando `TestClient` { #using-testclient }
    
    /// info | Informação
    
    Para usar o `TestClient`, primeiro instale [`httpx`](https://www.python-httpx.org).
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 6.1K bytes
    - Click Count (0)
  8. docs/fr/docs/tutorial/testing.md

    C’est basé sur [HTTPX](https://www.python-httpx.org), dont la conception s’inspire de Requests, ce qui le rend très familier et intuitif.
    
    Avec cela, vous pouvez utiliser [pytest](https://docs.pytest.org/) directement avec **FastAPI**.
    
    ## Utiliser `TestClient` { #using-testclient }
    
    /// info
    
    Pour utiliser `TestClient`, installez d’abord [`httpx`](https://www.python-httpx.org).
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 6.5K bytes
    - Click Count (0)
  9. docs/pt/docs/advanced/async-tests.md

    ## Executá-lo { #run-it }
    
    Você pode executar os seus testes normalmente via:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ---> 100%
    ```
    
    </div>
    
    ## Em Detalhes { #in-detail }
    
    O marcador `@pytest.mark.anyio` informa ao pytest que esta função de teste deve ser invocada de maneira assíncrona:
    
    {* ../../docs_src/async_tests/app_a_py310/test_main.py hl[7] *}
    
    /// tip | Dica
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 4.3K bytes
    - Click Count (0)
  10. docs/es/docs/tutorial/testing.md

    Está basado en [HTTPX](https://www.python-httpx.org), que a su vez está diseñado basado en Requests, por lo que es muy familiar e intuitivo.
    
    Con él, puedes usar [pytest](https://docs.pytest.org/) directamente con **FastAPI**.
    
    ## Usando `TestClient` { #using-testclient }
    
    /// info | Información
    
    Para usar `TestClient`, primero instala [`httpx`](https://www.python-httpx.org).
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 6.1K bytes
    - Click Count (0)
Back to Top