From 222e6133b1d0dcaa3b089224bb92e73db531d741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Thu, 8 Jun 2023 09:20:56 +0200 Subject: [PATCH] Catch Up to Changed Semantics of Certain Member Functions In particular Python::exec() now returns 'false' instead of throwing an exception if we don't have 'EMBEDDED_PYTHON'. Similarly for the Python::Python constructor when called with an 'Enable::ON' argument. --- tests/parser/EmbeddedPython.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/parser/EmbeddedPython.cpp b/tests/parser/EmbeddedPython.cpp index 2ef6a905c..49c4aabfb 100644 --- a/tests/parser/EmbeddedPython.cpp +++ b/tests/parser/EmbeddedPython.cpp @@ -51,11 +51,10 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(INSTANTIATE) { Python python; - BOOST_CHECK(!python.enabled()); - BOOST_CHECK_THROW(python.exec("print('Hello world')"), std::logic_error); - BOOST_CHECK(! Python::supported() ); + BOOST_CHECK_MESSAGE(!python.enabled(), "Python must not be enabled in a default-constructed Python object unless we have Embedded Python support"); + BOOST_CHECK_MESSAGE(!python.exec("print('Hello world')"), "Default-constructed Python object must not run Python code unless we have Embedded Python support"); + BOOST_CHECK_MESSAGE(!Python::supported(), "Python must not be supported unless we have Embedded Python support"); - BOOST_CHECK_THROW( Python{Python::Enable::ON}, std::logic_error ); Python python_cond(Python::Enable::TRY); BOOST_CHECK(!python_cond.enabled());