- Sort Score
- Num 10 results
- Language All
Results 41 - 50 of 350 for pytest (0.04 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
tests/test_security_scopes_sub_dependency.py
# Ref: https://github.com/fastapi/fastapi/discussions/6024#discussioncomment-8541913 from typing import Annotated import pytest from fastapi import Depends, FastAPI, Security from fastapi.security import SecurityScopes from fastapi.testclient import TestClient @pytest.fixture(name="call_counts") def call_counts_fixture(): return { "get_db_session": 0, "get_current_user": 0, "get_user_me": 0,
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2.9K bytes - Click Count (0) -
tests/test_multipart_installation.py
warnings.simplefilter("always") monkeypatch.delattr("multipart.multipart.parse_options_header", raising=False) with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/") async def root(f: bytes = File()): return f # pragma: nocover def test_incorrect_multipart_installed_multi_form(monkeypatch):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Oct 27 21:46:26 GMT 2024 - 5.7K bytes - Click Count (0) -
docs/en/docs/project-generation.md
- π [Docker Compose](https://www.docker.com) for development and production. - π Secure password hashing by default. - π JWT (JSON Web Token) authentication. - π« Email based password recovery. - β Tests with [Pytest](https://pytest.org). - π [Traefik](https://traefik.io) as a reverse proxy / load balancer. - π’ Deployment instructions using Docker Compose, including how to set up a frontend Traefik proxy to handle automatic HTTPS certificates.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 1.9K bytes - Click Count (0) -
tests/test_schema_compat_pydantic_v2.py
import pytest from dirty_equals import IsOneOf from fastapi import FastAPI from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel from tests.utils import needs_py310 @pytest.fixture(name="client") def get_client(): from enum import Enum app = FastAPI() class PlatformRole(str, Enum): admin = "admin" user = "user"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 23 12:36:49 GMT 2026 - 4.1K bytes - Click Count (0) -
tests/test_dependency_after_yield_websockets.py
from collections.abc import Generator from contextlib import contextmanager from typing import Annotated, Any import pytest from fastapi import Depends, FastAPI, WebSocket from fastapi.testclient import TestClient class Session: def __init__(self) -> None: self.data = ["foo", "bar", "baz"] self.open = True def __iter__(self) -> Generator[str, None, None]: for item in self.data:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2K bytes - Click Count (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"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1.7K bytes - Click Count (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_databaseCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Sep 29 03:29:38 GMT 2025 - 1.9K bytes - Click Count (0) -
tests/test_custom_route_class.py
import pytest from fastapi import APIRouter, FastAPI from fastapi.routing import APIRoute from fastapi.testclient import TestClient from inline_snapshot import snapshot from starlette.routing import Route app = FastAPI() class APIRouteA(APIRoute): x_type = "A" class APIRouteB(APIRoute): x_type = "B" class APIRouteC(APIRoute): x_type = "C" router_a = APIRouter(route_class=APIRouteA)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 3.3K bytes - Click Count (0) -
docs/ko/docs/project-generation.md
- π¦ λ€ν¬ λͺ¨λ μ§μ. - π κ°λ° νκ²½κ³Ό νλ‘λμ (μ΄μ)μ μν [Docker Compose](https://www.docker.com). - π κΈ°λ³ΈμΌλ‘ μ§μλλ μμ ν λΉλ°λ²νΈ ν΄μ±. - π JWT (JSON Web Token) μΈμ¦. - π« μ΄λ©μΌ κΈ°λ° λΉλ°λ²νΈ 볡ꡬ. - β [Pytest](https://pytest.org)λ₯Ό μ΄μ©ν ν μ€νΈ. - π 리λ²μ€ νλ‘μ / λ‘λ λ°Έλ°μλ‘μμ [Traefik](https://traefik.io). - π’ Docker Composeλ₯Ό μ΄μ©ν λ°°ν¬ μ§μΉ¨: μλ HTTPS μΈμ¦μλ₯Ό μ²λ¦¬νκΈ° μν νλ‘ νΈμλ Traefik νλ‘μ μ€μ λ°©λ²μ ν¬ν¨.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 2.3K bytes - Click Count (0) -
tests/test_regex_deprecated_params.py
from typing import Annotated import pytest from fastapi import FastAPI, Query from fastapi.exceptions import FastAPIDeprecationWarning from fastapi.testclient import TestClient from inline_snapshot import snapshot from .utils import needs_py310 def get_client(): app = FastAPI() with pytest.warns(FastAPIDeprecationWarning): @app.get("/items/") async def read_items(
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 5.1K bytes - Click Count (0)