- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 13 for value_error (0.07 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
tests/test_filter_pydantic_sub_model_pv2.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 6.7K bytes - Click Count (0) -
tests/test_dependency_after_yield_streaming.py
assert response.status_code == 500 assert response.text == "Internal Server Error" def test_broken_session_stream_raise(): # Can raise ValueError on Pydantic v2 and ExceptionGroup on Pydantic v1 with pytest.raises((ValueError, Exception)): client.get("/broken-session-stream") def test_broken_session_stream_no_raise(): """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) -
scripts/doc_parsing_utils.py
Syntax of comments depends on the language of the code block. Raises ValueError if the blocks are not compatible (different languages or different number of lines). """ start_line = block_a["start_line_no"] end_line_no = start_line + len(block_a["content"]) - 1 if block_a["lang"] != block_b["lang"]: raise ValueError( f"Code block (lines {start_line}-{end_line_no}) "Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:37:41 GMT 2026 - 23.5K bytes - Click Count (0) -
tests/test_openapi_schema_type.py
schema = Schema(type=type_value) assert schema.type == type_value def test_invalid_type_value() -> None: """Test that Schema raises ValueError for invalid type values.""" with pytest.raises(ValueError, match="2 validation errors for Schema"):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 685 bytes - Click Count (0) -
tests/test_dependency_after_yield_raise.py
try: yield "s" except CustomError as err: raise HTTPException(status_code=418, detail="Session error") from err def broken_dep() -> Any: yield "s" raise ValueError("Broken after yield") app = FastAPI() @app.get("/catching") def catching(d: Annotated[str, Depends(catching_dep)]) -> Any: raise CustomError("Simulated error during streaming")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_exception_handlers.py
RequestValidationError: request_validation_exception_handler, Exception: server_error_exception_handler, } ) client = TestClient(app) def raise_value_error(): raise ValueError() def dependency_with_yield(): yield raise_value_error() @app.get("/dependency-with-yield", dependencies=[Depends(dependency_with_yield)]) def with_yield(): ... @app.get("/http-exception")Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Dec 03 22:37:12 GMT 2024 - 2.4K bytes - Click Count (0) -
tests/test_sse.py
def test_server_sent_event_null_id_rejected(): with pytest.raises(ValueError, match="null"): ServerSentEvent(data="test", id="has\0null") def test_server_sent_event_negative_retry_rejected(): with pytest.raises(ValueError): ServerSentEvent(data="test", retry=-1) def test_server_sent_event_float_retry_rejected(): with pytest.raises(ValueError):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 9.8K bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial015_an_py310.py
"isbn-9781439512982": "Isaac Asimov: The Complete Stories, Vol. 2", } def check_valid_id(id: str): if not id.startswith(("isbn-", "imdb-")): raise ValueError('Invalid ID format, it must start with "isbn-" or "imdb-"') return id @app.get("/items/") async def read_items( id: Annotated[str | None, AfterValidator(check_valid_id)] = None, ): if id:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 01 22:02:35 GMT 2025 - 768 bytes - Click Count (0) -
scripts/mkdocs_hooks.py
elif isinstance(values[0], list): resolve_files(items=values[0], files=files, config=config) else: raise ValueError(f"Unexpected value: {values}") def on_files(files: Files, *, config: MkDocsConfig) -> Files: resolve_files(items=config.nav or [], files=files, config=config) if "logo" in config.theme:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 6.6K bytes - Click Count (0) -
tests/test_jsonable_encoder.py
assert jsonable_encoder(item, exclude={}) == {"name": "foo", "count": 100} def test_encode_unsupported(): unserializable = Unserializable() with pytest.raises(ValueError): jsonable_encoder(unserializable) def test_encode_custom_json_encoders_model_pydanticv2(): from pydantic import field_serializer class ModelWithCustomEncoder(BaseModel):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 9.2K bytes - Click Count (0)