pytest_jsonschema_snapshot.stats

Module for collecting and displaying statistics about schemas.

Attributes

Classes

SchemaStats

Class for collecting and displaying statistics about schemas

Module Contents

class SchemaStats[source]

Class for collecting and displaying statistics about schemas

created: List[str] = [][source]
updated: List[str] = [][source]
updated_diffs: Dict[str, str][source]
uncommitted: List[str] = [][source]
uncommitted_diffs: Dict[str, str][source]
deleted: List[str] = [][source]
unused: List[str] = [][source]
add_created(schema_name: str) None[source]

Adds created schema

add_updated(
schema_name: str,
diff: str | None = None,
) None[source]

Adds updated schema

add_uncommitted(
schema_name: str,
diff: str | None = None,
) None[source]

Adds schema with uncommitted changes

add_deleted(schema_name: str) None[source]

Adds deleted schema

add_unused(schema_name: str) None[source]

Adds unused schema

has_changes() bool[source]

Returns True if any schema has changes

has_any_info() bool[source]

Is there any information about schemas

__str__() str[source]
print_summary(
terminalreporter: pytest.TerminalReporter,
update_mode: bool,
) None[source]

Prints schema summary to pytest terminal output. Pairs of “<name>.schema.json” + “<name>.json” are merged into one line: “<name>.schema.json + original” (if original is present).

GLOBAL_STATS[source]