Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 171 - 180 of 605 for c1test (0.04 seconds)

  1. tests/test_request_params/test_query/test_optional_str.py

                "in": "query",
            }
        ]
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-str", "/model-optional-str"],
    )
    def test_optional_str_missing(path: str):
        client = TestClient(app)
        response = client.get(path)
        assert response.status_code == 200
        assert response.json() == {"p": None}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-str", "/model-optional-str"],
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 8.1K bytes
    - Click Count (0)
  2. README.md

    </p>
    <p align="center">
    <a href="https://github.com/fastapi/fastapi/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster" target="_blank">
        <img src="https://github.com/fastapi/fastapi/actions/workflows/test.yml/badge.svg?event=push&branch=master" alt="Test">
    </a>
    <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/fastapi" target="_blank">
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Dec 25 11:01:37 GMT 2025
    - 26.4K bytes
    - Click Count (0)
  3. tests/test_request_params/test_cookie/test_required_str.py

    from typing import Annotated
    
    import pytest
    from dirty_equals import IsOneOf
    from fastapi import Cookie, FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.get("/required-str")
    async def read_required_str(p: Annotated[str, Cookie()]):
        return {"p": p}
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 10.2K bytes
    - Click Count (0)
  4. tests/test_tutorial/test_request_form_models/test_tutorial001.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial001_py39",
            "tutorial001_an_py39",
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.request_form_models.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_post_body_form(client: TestClient):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 5.7K bytes
    - Click Count (0)
  5. tests/test_tutorial/test_request_forms/test_tutorial001.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial001_py39",
            "tutorial001_an_py39",
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.request_forms.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_post_body_form(client: TestClient):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 5.7K bytes
    - Click Count (0)
  6. .github/ISSUE_TEMPLATE/bug_report.yaml

            out the following fields. Before we begin, please make sure that the bug is still present in
            the [latest](https://github.com/google/guava/releases/latest) version of Guava available.
            If it's already fixed in the latest version of Guava, then please just update your Guava
            version instead.
    
      - type: input
        attributes:
          label: Guava Version
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue Jul 16 20:08:25 GMT 2024
    - 2.9K bytes
    - Click Count (0)
  7. tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py

    import importlib
    
    import pytest
    from dirty_equals import IsList
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial002_py39"),
            pytest.param("tutorial002_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest) -> TestClient:
        mod = importlib.import_module(
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Dec 26 10:43:02 GMT 2025
    - 7.6K bytes
    - Click Count (0)
  8. docs/zh/docs/advanced/async-tests.md

    {* ../../docs_src/async_tests/test_main.py *}
    
    ## 运行测试
    
    您可以通过以下方式照常运行测试:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ---> 100%
    ```
    
    </div>
    
    ## 详细说明
    
    这个标记 `@pytest.mark.anyio` 会告诉 pytest 该测试函数应该被异步调用:
    
    {* ../../docs_src/async_tests/test_main.py hl[7] *}
    
    /// tip
    
    请注意,测试函数现在用的是 `async def`,而不是像以前使用 `TestClient` 时那样只是 `def` 。
    
    ///
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 17 21:49:06 GMT 2024
    - 3.9K bytes
    - Click Count (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):
            app = FastAPI()
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.6K bytes
    - Click Count (0)
  10. tests/test_request_params/test_file/test_required.py

    from typing import Annotated
    
    import pytest
    from fastapi import FastAPI, File, UploadFile
    from fastapi.testclient import TestClient
    
    from .utils import get_body_model_name
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.post("/required-bytes", operation_id="required_bytes")
    async def read_required_bytes(p: Annotated[bytes, File()]):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 10.8K bytes
    - Click Count (0)
Back to Top