testing
Class info¶
🛈 DocStrings¶
Utilities for running async code in a synchronous context.
open_in_playground
¶
open_in_playground(
file: ModuleType | str | PathLike[str],
title: str = "Open in Pydantic Playground",
dependencies: list[str] | None = None,
open_browser: bool = True,
) -> str
Create a link to Pydantic playground with a pre-populated file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
ModuleType | str | PathLike[str]
|
The file to include in the playground. Can be: - A module - A file path |
required |
title
|
str
|
The title of the link (not used in URL generation) |
'Open in Pydantic Playground'
|
dependencies
|
list[str] | None
|
List of package dependencies to include as PEP 723 header |
None
|
open_browser
|
bool
|
Whether to automatically open the link in a browser |
True
|
Returns:
| Type | Description |
|---|---|
str
|
A URL string pointing to the Pydantic playground |