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

Function test_implicit_conversion_life_support

tests/test_class.py:317–322  ·  view source on GitHub ↗

Ensure the lifetime of temporary objects created for implicit conversions

()

Source from the content-addressed store, hash-verified

315
316
317def test_implicit_conversion_life_support():
318 """Ensure the lifetime of temporary objects created for implicit conversions"""
319 assert m.implicitly_convert_argument(UserType(5)) == 5
320 assert m.implicitly_convert_variable(UserType(5)) == 5
321
322 assert "outside a bound function" in m.implicitly_convert_variable_fail(UserType(5))
323
324
325def test_operator_new_delete(capture):

Callers

nothing calls this directly

Calls 1

UserTypeClass · 0.90

Tested by

no test coverage detected