Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 294 for ptrtest (0.09 sec)

  1. tests/test_schema_extra_examples.py

        ):
            return item_id
    
        with pytest.warns(DeprecationWarning):
    
            @app.get("/path_example_examples/{item_id}")
            def path_example_examples(
                item_id: str = Path(
                    example="item_overridden",
                    examples=["item_1", "item_2"],
                ),
            ):
                return item_id
    
        with pytest.warns(DeprecationWarning):
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 37.7K bytes
    - Viewed (0)
  2. docs/ja/docs/tutorial/testing.md

    ///
    
    ## 実行
    
    後は、`pytest` をインストールするだけです:
    
    <div class="termy">
    
    ```console
    $ pip install pytest
    
    ---> 100%
    ```
    
    </div>
    
    ファイルを検知し、自動テストを実行し、結果のレポートを返します。
    
    以下でテストを実行します:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ================ test session starts ================
    platform linux -- Python 3.6.9, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_header_params/test_tutorial002_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial002_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  4. tests/test_computed_fields.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from .utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        app = FastAPI()
    
        from pydantic import BaseModel, computed_field
    
        class Rectangle(BaseModel):
            width: int
            length: int
    
            @computed_field
            @property
            def area(self) -> int:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_header_params/test_tutorial003_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial003_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  6. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

    import pytest
    from fastapi.exceptions import ResponseValidationError
    from fastapi.testclient import TestClient
    
    from ..utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from .app_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    def test_filter_sub_model(client: TestClient):
        response = client.get("/model/modelA")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_testing/test_tutorial003.py

    import pytest
    
    
    def test_main():
        with pytest.warns(DeprecationWarning):
            from docs_src.app_testing.tutorial003 import test_read_items
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 167 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_header_params/test_tutorial003_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial003_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  9. tests/test_invalid_path_param.py

    import pytest
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    def test_invalid_sequence():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/{id}")
            def read_items(id: List[Item]):
                pass  # pragma: no cover
    
    
    def test_invalid_tuple():
        with pytest.raises(AssertionError):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Jun 03 17:59:40 UTC 2019
    - 1.7K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/testing.md

    ## Запуск тестов
    
    Далее Вам нужно установить `pytest`:
    
    <div class="termy">
    
    ```console
    $ pip install pytest
    
    ---> 100%
    ```
    
    </div>
    
    Он автоматически найдёт все файлы и тесты, выполнит их и предоставит Вам отчёт о результатах тестирования.
    
    Запустите тесты командой `pytest` и увидите результат:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.2K bytes
    - Viewed (0)
Back to top