pytest_jsonschema_snapshot.tools¶
Submodules¶
Classes¶
A thin wrapper around |
|
Lightweight helper that converts a callable into a string identifier |
Package Contents¶
- class JsonToSchemaConverter(
- schema_uri: str = 'https://json-schema.org/draft/2020-12/schema',
- *,
- format_mode: _FormatMode = 'on',
A thin wrapper around
genson.SchemaBuilder
.
- class NameMaker[source]¶
Lightweight helper that converts a callable into a string identifier using a tiny placeholder-based template language (keeps backward compatibility with the original test-suite).
Supported placeholders¶
{package} – full module path (
tests.test_mod
){package_full=SEP} – same but with custom separator (default “.”)
{path} / {path=SEP} – module path without the first segment
{class} – class name or empty string
{method} – function / method name
{class_method} / {…=SEP} –
Class{SEP}method
or justmethod
Unknown placeholders collapse to an empty string.
- After substitution:
“//”, “..”, “–” are collapsed to “/”, “.”, “-” respectively;
double underscores are preserved so
__call__
stays intact.