- Sort Score
- Num 10 results
- Language All
Results 51 - 60 of 409 for pytest (0.07 seconds)
-
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) -
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):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 3.8K bytes - Click Count (0) -
tests/test_dependency_after_yield_streaming.py
from collections.abc import Generator from contextlib import contextmanager from typing import Annotated, Any import pytest from fastapi import Depends, FastAPI from fastapi.responses import StreamingResponse 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]:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 3.2K bytes - Click Count (0) -
docs/zh/docs/project-generation.md
- 🧪 [Playwright](https://playwright.dev) 用于端到端测试。 - 🦇 支持暗黑模式。 - 🐋 [Docker Compose](https://www.docker.com) 用于开发与生产。 - 🔒 默认启用安全的密码哈希。 - 🔑 JWT(JSON Web Token)认证。 - 📫 基于邮箱的密码找回。 - ✅ 使用 [Pytest](https://pytest.org) 进行测试。 - 📞 [Traefik](https://traefik.io) 用作反向代理/负载均衡。 - 🚢 使用 Docker Compose 的部署指南,包括如何设置前端 Traefik 代理以自动处理 HTTPS 证书。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 1.8K bytes - Click Count (0) -
docs/zh-hant/docs/project-generation.md
- 🧪 [Playwright](https://playwright.dev) 用於端到端測試。 - 🦇 支援深色模式。 - 🐋 [Docker Compose](https://www.docker.com) 用於開發與正式環境。 - 🔒 預設即採用安全的密碼雜湊。 - 🔑 JWT(JSON Web Token)驗證。 - 📫 以 Email 為基礎的密碼重設。 - ✅ 使用 [Pytest](https://pytest.org) 的測試。 - 📞 [Traefik](https://traefik.io) 作為反向代理/負載平衡器。 - 🚢 使用 Docker Compose 的部署指引,包含如何設定前端 Traefik 代理以自動處理 HTTPS 憑證。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 1.8K bytes - Click Count (0)