Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for cover (0.02 sec)

  1. tests/test_pydantic_v1_error.py

            def endpoint(data: ParamModelV1):  # pragma: no cover
                return data
    
    
    def test_raises_pydantic_v1_model_in_return_type() -> None:
        class ReturnModelV1(BaseModel):
            name: str
    
        app = FastAPI()
    
        with pytest.raises(PydanticV1NotSupportedError):
    
            @app.get("/return")
            def endpoint() -> ReturnModelV1:  # pragma: no cover
                return ReturnModelV1(name="test")
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  2. tests/test_additional_responses_custom_model_in_callback.py

    
    @callback_router.get(
        "{$callback_url}/callback/", responses={400: {"model": CustomModel}}
    )
    def callback_route():
        pass  # pragma: no cover
    
    
    @app.post("/", callbacks=callback_router.routes)
    def main_route(callback_url: HttpUrl):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_query_params_str_validations/test_tutorial006c.py

    )
    def test_query_params_str_validations_no_query(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {  # pragma: no cover
            "items": [{"item_id": "Foo"}, {"item_id": "Bar"}],
        }
    
    
    @pytest.mark.xfail(
        reason="Code example is not valid. See https://github.com/fastapi/fastapi/issues/12419"
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 5K bytes
    - Viewed (0)
  4. fastapi/_compat/shared.py

    ) -> bool:
        try:
            return isinstance(cls, type) and issubclass(cls, class_or_tuple)  # type: ignore[arg-type]
        except TypeError:  # pragma: no cover
            if isinstance(cls, WithArgsTypes):
                return False
            raise  # pragma: no cover
    
    
    def _annotation_is_sequence(annotation: Union[type[Any], None]) -> bool:
        if lenient_issubclass(annotation, (str, bytes)):
            return False
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_settings/test_app01.py

    
    def test_settings_validation_error(mod_name: str, monkeypatch: MonkeyPatch):
        monkeypatch.delenv("ADMIN_EMAIL", raising=False)
        if mod_name in sys.modules:
            del sys.modules[mod_name]  # pragma: no cover
    
        with pytest.raises(ValidationError) as exc_info:
            importlib.import_module(mod_name)
        assert exc_info.value.errors() == [
            {
                "loc": ("admin_email",),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_debugging/test_tutorial001.py

        client = TestClient(mod.app)
        return client
    
    
    def test_uvicorn_run_is_not_called_on_import():
        if sys.modules.get(MOD_NAME):
            del sys.modules[MOD_NAME]  # pragma: no cover
        with unittest.mock.patch("uvicorn.run") as uvicorn_run_mock:
            importlib.import_module(MOD_NAME)
        uvicorn_run_mock.assert_not_called()
    
    
    def test_get_root(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  7. tests/test_params_repr.py

    from typing import Any
    
    from fastapi.params import Body, Cookie, Header, Param, Path, Query
    
    test_data: list[Any] = ["teststr", None, ..., 1, []]
    
    
    def get_user():
        return {}  # pragma: no cover
    
    
    def test_param_repr_str():
        assert repr(Param("teststr")) == "Param(teststr)"
    
    
    def test_param_repr_none():
        assert repr(Param(None)) == "Param(None)"
    
    
    def test_param_repr_ellipsis():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  8. pyproject.toml

        "docs_src/settings/app03_py39/config_pv1.py",
        "docs_src/settings/app03_an_py39/config_pv1.py",
        "docs_src/settings/tutorial001_pv1_py39.py",
    ]
    
    [tool.coverage.report]
    show_missing = true
    sort = "-Cover"
    
    [tool.coverage.html]
    show_contexts = true
    
    [tool.ruff.lint]
    select = [
        "E",  # pycodestyle errors
        "W",  # pycodestyle warnings
        "F",  # pyflakes
        "I",  # isort
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  9. fastapi/openapi/models.py

    try:
        import email_validator
    
        assert email_validator  # make autoflake ignore the unused import
        from pydantic import EmailStr
    except ImportError:  # pragma: no cover
    
        class EmailStr(str):  # type: ignore
            @classmethod
            def __get_validators__(cls) -> Iterable[Callable[..., Any]]:
                yield cls.validate
    
            @classmethod
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  10. fastapi/_compat/v2.py

    try:
        from pydantic_core.core_schema import (
            with_info_plain_validator_function as with_info_plain_validator_function,
        )
    except ImportError:  # pragma: no cover
        from pydantic_core.core_schema import (
            general_plain_validator_function as with_info_plain_validator_function,  # noqa: F401
        )
    
    RequiredParam = PydanticUndefined
    Undefined = PydanticUndefined
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
Back to top