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

Function test_python_builtins

tests/test_callbacks.py:159–162  ·  view source on GitHub ↗

Test if python builtins like sum() can be used as callbacks

()

Source from the content-addressed store, hash-verified

157 reason="PyPy segfaults on here. See discussion on #1413.",
158)
159def test_python_builtins():
160 """Test if python builtins like sum() can be used as callbacks"""
161 assert m.test_sum_builtin(sum, [1, 2, 3]) == 6
162 assert m.test_sum_builtin(sum, []) == 0
163
164
165@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected