mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797)
* PYBIND11_OBJECT_CVT should use namespace for error_already_set() This change makes the macro usable outside of pybind11 namespace. * added test for use of PYBIND11_OBJECT_CVT for classes in external to pybind11 namespaces * Extended test_pytypes.cpp and test_pytest.py The added test defines a dummy function that takes a custom-defined class external::float_ that uses PYBIND11_OBJECT_CVT * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed issues pointed out by CI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed memory leak in default constructor Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -634,3 +634,8 @@ def test_implementation_details():
|
||||
assert m.tuple_item_set_ssize_t() == ("emely", "edmond")
|
||||
assert m.tuple_item_get_size_t(tup) == 93
|
||||
assert m.tuple_item_set_size_t() == ("candy", "cat")
|
||||
|
||||
|
||||
def test_external_float_():
|
||||
r1 = m.square_float_(2.0)
|
||||
assert r1 == 4.0
|
||||
|
||||
Reference in New Issue
Block a user