- Sort Score
- Result 10 results
- Languages All
Results 241 - 250 of 601 for pytest (0.03 sec)
-
tests/test_dependency_partial.py
from collections.abc import AsyncGenerator, Generator from functools import partial from typing import Annotated import pytest from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() def function_dependency(value: str) -> str: return value async def async_function_dependency(value: str) -> str: return value def gen_dependency(value: str) -> Generator[str, None, None]:
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.3K bytes - Viewed (0) -
docs/pt/docs/project-generation.md
- 🐋 [Docker Compose](https://www.docker.com) para desenvolvimento e produção. - 🔒 _Hash_ seguro de senhas por padrão. - 🔑 Autenticação por token JWT. - 📫 Recuperação de senhas baseada em email. - ✅ Testes com [Pytest](https://pytest.org). - 📞 [Traefik](https://traefik.io) como proxy reverso / balanceador de carga.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 10:17:03 UTC 2025 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_graphql/test_tutorial001.py
import warnings import pytest from starlette.testclient import TestClient warnings.filterwarnings( "ignore", message=r"The 'lia' package has been renamed to 'cross_web'\..*", category=DeprecationWarning, ) from docs_src.graphql_.tutorial001_py39 import app # noqa: E402 @pytest.fixture(name="client") def get_client() -> TestClient: return TestClient(app) def test_query(client: TestClient):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py
import pytest from fastapi.testclient import TestClient from docs_src.path_operation_configuration.tutorial006_py39 import app client = TestClient(app) @pytest.mark.parametrize( "path,expected_status,expected_response", [ ("/items/", 200, [{"name": "Foo", "price": 42}]), ("/users/", 200, [{"username": "johndoe"}]), ("/elements/", 200, [{"item_id": "Foo"}]), ], )
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.4K bytes - Viewed (0) -
scripts/test.sh
#!/usr/bin/env bash set -e set -x export PYTHONPATH=./docs_src
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sun Jun 11 21:38:15 UTC 2023 - 99 bytes - Viewed (0) -
tests/test_dependency_after_yield_raise.py
from typing import Annotated, Any import pytest from fastapi import Depends, FastAPI, HTTPException from fastapi.testclient import TestClient class CustomError(Exception): pass def catching_dep() -> Any: try: yield "s" except CustomError as err: raise HTTPException(status_code=418, detail="Session error") from err def broken_dep() -> Any: yield "s"
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 1.7K bytes - Viewed (0) -
tests/test_dependency_yield_except_httpexception.py
import pytest from fastapi import Body, Depends, FastAPI, HTTPException from fastapi.testclient import TestClient initial_fake_database = {"rick": "Rick Sanchez"} fake_database = initial_fake_database.copy() initial_state = {"except": False, "finally": False} state = initial_state.copy() app = FastAPI() async def get_database(): temp_database = fake_database.copy() try: yield temp_databaseRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Sep 29 03:29:38 UTC 2025 - 1.9K bytes - Viewed (0) -
docs/ko/docs/advanced/async-tests.md
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 10 11:03:16 UTC 2024 - 4.7K bytes - Viewed (0) -
tests/test_union_body_discriminator_annotated.py
# Ref: https://github.com/fastapi/fastapi/discussions/14495 from typing import Annotated, Union import pytest from fastapi import FastAPI from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel @pytest.fixture(name="client") def client_fixture() -> TestClient: from fastapi import Body from pydantic import Discriminator, Tag class Cat(BaseModel):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 7.7K bytes - Viewed (0) -
tests/test_arbitrary_types.py
from typing import Annotated import pytest from fastapi import FastAPI from fastapi.testclient import TestClient from inline_snapshot import snapshot @pytest.fixture(name="client") def get_client(): from pydantic import ( BaseModel, ConfigDict, PlainSerializer, TypeAdapter, WithJsonSchema, ) class FakeNumpyArray: def __init__(self):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 3.8K bytes - Viewed (0)