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

Function test_pass_std_vector_int

tests/test_stl.py:473–483  ·  view source on GitHub ↗
(fn, offset)

Source from the content-addressed store, hash-verified

471 ("fn", "offset"), [(m.pass_std_vector_int, 0), (m.pass_std_array_int_2, 1)]
472)
473def test_pass_std_vector_int(fn, offset):
474 assert fn([7, 13]) == 140 + offset
475 assert fn({6, 2}) == 116 + offset
476 assert fn({"x": 8, "y": 11}.values()) == 138 + offset
477 assert fn({3: None, 9: None}.keys()) == 124 + offset
478 assert fn(i for i in [4, 17]) == 142 + offset
479 assert fn(map(lambda i: i * 3, [8, 7])) == 190 + offset # noqa: C417
480 with pytest.raises(TypeError):
481 fn({"x": 0, "y": 1})
482 with pytest.raises(TypeError):
483 fn({})
484
485
486def test_pass_std_vector_pair_int():

Callers

nothing calls this directly

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected