MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_eval_closure

Function test_eval_closure

tests/test_eval.py:38–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36
37
38def test_eval_closure():
39 global_, local = m.test_eval_closure()
40
41 assert global_["closure_value"] == 42
42 assert local["closure_value"] == 0
43
44 assert "local_value" not in global_
45 assert local["local_value"] == 0
46
47 assert "func_global" not in global_
48 assert local["func_global"]() == 42
49
50 assert "func_local" not in global_
51 with pytest.raises(NameError):
52 local["func_local"]()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected