Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_invalid_response_model_raises (0.37 sec)

  1. tests/test_response_model_invalid.py

    from typing import List
    
    import pytest
    from fastapi import FastAPI
    from fastapi.exceptions import FastAPIError
    
    
    class NonPydanticModel:
        pass
    
    
    def test_invalid_response_model_raises():
        with pytest.raises(FastAPIError):
            app = FastAPI()
    
            @app.get("/", response_model=NonPydanticModel)
            def read_root():
                pass  # pragma: nocover
    
    
    def test_invalid_response_model_sub_type_raises():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 29 13:04:35 GMT 2020
    - 1.1K bytes
    - Viewed (0)
Back to top