pytest_jsonschema_snapshot.core¶
Core logic of the plugin.
Classes¶
Module Contents¶
- class SchemaShot(
- root_dir: Path,
- differ: jsonschema_diff.JsonSchemaDiff,
- callable_regex: str = '{class_method=.}',
- format_mode: str = 'on',
- update_mode: bool = False,
- reset_mode: bool = False,
- update_actions: dict[str, bool] = {},
- save_original: bool = False,
- debug_mode: bool = False,
- snapshot_dir_name: str = '__snapshots__',
-
- assert_json_match( ) bool | None [source]¶
Asserts for JSON, converts it to schema and then compares.
- Returns:
True – the schema has been updated, False – the schema has not changed, None – a new schema has been created.
- assert_schema_match(
- schema: dict[str, Any],
- name: str | int | Callable | list[str | int | Callable],
- *,
- data: dict | None = None,
Accepts a JSON-schema directly and compares it immediately.
- Returns:
True – the schema has been updated, False – the schema has not changed, None – a new schema has been created.