Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 70 for test_int (0.16 sec)

  1. docs/en/docs/advanced/testing-dependencies.md

    # Testing Dependencies with Overrides
    
    ## Overriding dependencies during testing
    
    There are some scenarios where you might want to override a dependency during testing.
    
    You don't want the original dependency to run (nor any of the sub-dependencies it might have).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/testing-dependencies.md

        ```Python hl_lines="26-27  30"
        {!> ../../../docs_src/dependency_testing/tutorial001_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python hl_lines="28-29  32"
        {!> ../../../docs_src/dependency_testing/tutorial001_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="29-30  33"
        {!> ../../../docs_src/dependency_testing/tutorial001_an.py!}
        ```
    
    === "Python 3.10+ nicht annotiert"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:17:32 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  3. docs/em/docs/advanced/testing-websockets.md

    # 🔬 *️⃣
    
    👆 💪 ⚙️ 🎏 `TestClient` 💯*️⃣.
    
    👉, 👆 ⚙️ `TestClient` `with` 📄, 🔗*️⃣:
    
    ```Python hl_lines="27-31"
    {!../../../docs_src/app_testing/tutorial002.py!}
    ```
    
    !!! note
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 372 bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/testing-database.md

    # 测试数据库
    
    您还可以使用[测试依赖项](testing-dependencies.md){.internal-link target=_blank}中的覆盖依赖项方法变更测试的数据库。
    
    实现设置其它测试数据库、在测试后回滚数据、或预填测试数据等操作。
    
    本章的主要思路与上一章完全相同。
    
    ## 为 SQL 应用添加测试
    
    为了使用测试数据库,我们要升级 [SQL 关系型数据库](../tutorial/sql-databases.md){.internal-link target=_blank} 一章中的示例。
    
    应用的所有代码都一样,直接查看那一章的示例代码即可。
    
    本章只是新添加了测试文件。
    
    正常的依赖项 `get_db()` 返回数据库会话。
    
    测试时使用覆盖依赖项返回自定义数据库会话代替正常的依赖项。
    
    本例中,要创建仅用于测试的临时数据库。
    
    ## 文件架构
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jan 28 18:09:26 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_sql_databases/test_testing_databases_py39.py

    import importlib
    import os
    from pathlib import Path
    
    import pytest
    
    from ...utils import needs_py39, needs_pydanticv1
    
    
    @needs_py39
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_testing_dbs_py39(tmp_path_factory: pytest.TempPathFactory):
        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./test.db")
        if test_db.is_file():  # pragma: nocover
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 822 bytes
    - Viewed (0)
  6. docs/pt/docs/deployment/versions.md

    ## Atualizando as versões do FastAPI
    
    Você deve adicionar testes para a sua aplicação.
    
    Com **FastAPI** isso é muito fácil (graças a Starlette), verifique a documentação: [Testing](../tutorial/testing.md){.internal-link target=\_blank}
    
    Após a criação dos testes, você pode atualizar a sua versão do **FastAPI** para uma mais recente, execute os testes para se certificar de que todo o seu código está funcionando corretamente.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 29 20:14:40 GMT 2021
    - 3.8K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/settings.md

        ```Python hl_lines="16  18-20"
        {!> ../../../docs_src/settings/app02/main.py!}
        ```
    
    ### Settings and testing
    
    Then it would be very easy to provide a different settings object during testing by creating a dependency override for `get_settings`:
    
    ```Python hl_lines="9-10  13  21"
    {!../../../docs_src/settings/app02/test_main.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_testing/test_main_b_an_py310.py

    from ...utils import needs_py310
    
    
    @needs_py310
    def test_app():
        from docs_src.app_testing.app_b_an_py310 import test_main
    
        test_main.test_create_existing_item()
        test_main.test_create_item()
        test_main.test_create_item_bad_token()
        test_main.test_read_nonexistent_item()
        test_main.test_read_item()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 360 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_testing_dependencies/test_tutorial001_an.py

    from docs_src.dependency_testing.tutorial001_an import (
        app,
        client,
        test_override_in_items,
        test_override_in_items_with_params,
        test_override_in_items_with_q,
    )
    
    
    def test_override_in_items_run():
        test_override_in_items()
    
    
    def test_override_in_items_with_q_run():
        test_override_in_items_with_q()
    
    
    def test_override_in_items_with_params_run():
        test_override_in_items_with_params()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/testing.md

    === "Python 3.10+"
    
        ```Python
        {!> ../../../docs_src/app_testing/app_b_an_py310/main.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python
        {!> ../../../docs_src/app_testing/app_b_an_py39/main.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python
        {!> ../../../docs_src/app_testing/app_b_an/main.py!}
        ```
    
    === "Python 3.10+ без Annotated"
    
        !!! tip "Подсказка"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.2K bytes
    - Viewed (0)
Back to top