From e76cdab6dd77bad411e6ac9372ee527aff89ef17 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 2 Jan 2021 10:15:39 +0100 Subject: Update pybind11 to version 2.6.1 --- 3rdparty/pybind11/tests/test_opaque_types.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to '3rdparty/pybind11/tests/test_opaque_types.py') diff --git a/3rdparty/pybind11/tests/test_opaque_types.py b/3rdparty/pybind11/tests/test_opaque_types.py index 6b3802fd..77379463 100644 --- a/3rdparty/pybind11/tests/test_opaque_types.py +++ b/3rdparty/pybind11/tests/test_opaque_types.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import pytest from pybind11_tests import opaque_types as m from pybind11_tests import ConstructorStats, UserType @@ -31,12 +32,15 @@ def test_pointers(msg): with pytest.raises(TypeError) as excinfo: m.get_void_ptr_value([1, 2, 3]) # This should not work - assert msg(excinfo.value) == """ + assert ( + msg(excinfo.value) + == """ get_void_ptr_value(): incompatible function arguments. The following argument types are supported: 1. (arg0: capsule) -> int Invoked with: [1, 2, 3] """ # noqa: E501 line too long + ) assert m.return_null_str() is None assert m.get_null_str_value(m.return_null_str()) is not None @@ -44,3 +48,11 @@ def test_pointers(msg): ptr = m.return_unique_ptr() assert "StringList" in repr(ptr) assert m.print_opaque_list(ptr) == "Opaque list: [some value]" + + +def test_unions(): + int_float_union = m.IntFloat() + int_float_union.i = 42 + assert int_float_union.i == 42 + int_float_union.f = 3.0 + assert int_float_union.f == 3.0 -- cgit v1.2.3