MCPcopy
hub / github.com/copier-org/copier / test_strictundefined_undefined_variable

Function test_strictundefined_undefined_variable

tests/test_jinja2_undefined.py:64–82  ·  view source on GitHub ↗
(
    tmp_path_factory: pytest.TempPathFactory,
)

Source from the content-addressed store, hash-verified

62
63
64def test_strictundefined_undefined_variable(
65 tmp_path_factory: pytest.TempPathFactory,
66) -> None:
67 src, dst = map(tmp_path_factory.mktemp, ("src", "dst"))
68
69 build_file_tree(
70 {
71 (src / "copier.yaml"): (
72 """\
73 _envops:
74 undefined: jinja2.StrictUndefined
75 """
76 ),
77 (src / "test.jinja"): "{{ undefined_variable }}",
78 }
79 )
80
81 with pytest.raises(UndefinedError, match="'undefined_variable' is undefined"):
82 copier.run_copy(str(src), dst)

Callers

nothing calls this directly

Calls 2

build_file_treeFunction · 0.85
run_copyMethod · 0.80

Tested by

no test coverage detected