Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for user_exists (0.16 seconds)

  1. tests/test_param_in_path_and_dependency.py

    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    
    async def user_exists(user_id: int):
        return True
    
    
    @app.get("/users/{user_id}", dependencies=[Depends(user_exists)])
    async def read_users(user_id: int):
        pass
    
    
    client = TestClient(app)
    
    
    def test_read_users():
        response = client.get("/users/42")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 3.6K bytes
    - Click Count (0)
Back to Top