Add static method bool Python::enabled()

This commit is contained in:
Joakim Hove
2020-03-16 15:59:13 +01:00
parent d06a5a78e0
commit c7f6b22bdf
3 changed files with 10 additions and 1 deletions

View File

@@ -40,12 +40,14 @@ BOOST_AUTO_TEST_CASE(INSTANTIATE) {
Python python;
BOOST_CHECK(!python);
BOOST_CHECK_THROW(python.exec("print('Hello world')"), std::logic_error);
BOOST_CHECK(! Python::enabled() );
}
#else
BOOST_AUTO_TEST_CASE(INSTANTIATE) {
Python python;
BOOST_CHECK(Python::enabled());
BOOST_CHECK(python);
BOOST_CHECK_NO_THROW(python.exec("print('Hello world')"));