pytest_jsonschema_snapshot.tools.name_maker¶
Classes¶
Lightweight helper that converts a callable into a string identifier |
Module Contents¶
- 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.