diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-10-18 14:24:21 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-10-18 14:24:21 +1100 |
commit | 5d55a2812130f2fbfb7046f3b376948959ce843e (patch) | |
tree | 3f1861bde4d98724d5c121b38e3bec504f29a49f | |
parent | 02e6f0e5e8854e5578151aa18f5c586c81fd53bd (diff) | |
download | mongo-5d55a2812130f2fbfb7046f3b376948959ce843e.tar.gz |
Fix the Python check for a verbose build: it can't be a connection method, that's too late.
-rw-r--r-- | lang/python/wiredtiger.i | 37 | ||||
-rw-r--r-- | test/suite/test_bulk01.py | 2 | ||||
-rw-r--r-- | test/suite/test_txn06.py | 9 |
3 files changed, 26 insertions, 22 deletions
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i index 3573ce8c127..5e88855276a 100644 --- a/lang/python/wiredtiger.i +++ b/lang/python/wiredtiger.i @@ -381,7 +381,6 @@ COMPARE_OK(__wt_cursor::compare) COMPARE_OK(__wt_cursor::search_near) /* Lastly, some methods need no (additional) error checking. */ -%exception __wt_connection::diagnostic_build; %exception __wt_connection::get_home; %exception __wt_connection::is_new; %exception __wt_connection::search_near; @@ -393,6 +392,8 @@ COMPARE_OK(__wt_cursor::search_near) %exception __wt_cursor::_set_value_str; %exception wiredtiger_strerror; %exception wiredtiger_version; +%exception diagnostic_build; +%exception verbose_build; /* WT_ASYNC_OP customization. */ /* First, replace the varargs get / set methods with Python equivalents. */ @@ -807,23 +808,27 @@ typedef int int_void; int _freecb() { return (0); } +}; - int diagnostic_build() { -%#ifdef HAVE_DIAGNOSTIC - return 1; -%#else - return 0; -%#endif - } +%{ +int diagnostic_build() { +#ifdef HAVE_DIAGNOSTIC + return 1; +#else + return 0; +#endif +} - int verbose_build() { -%#ifdef HAVE_VERBOSE - return 1; -%#else - return 0; -%#endif - } -}; +int verbose_build() { +#ifdef HAVE_VERBOSE + return 1; +#else + return 0; +#endif +} +%} +int diagnostic_build(); +int verbose_build(); /* Remove / rename parts of the C API that we don't want in Python. */ %immutable __wt_cursor::session; diff --git a/test/suite/test_bulk01.py b/test/suite/test_bulk01.py index 5866eff57d0..c99cedae1e6 100644 --- a/test/suite/test_bulk01.py +++ b/test/suite/test_bulk01.py @@ -100,7 +100,7 @@ class test_bulk_load_row_order(wttest.WiredTigerTestCase): cursor.set_value(value_populate(cursor, 1)) cursor.insert() - if not self.conn.diagnostic_build(): + if not wiredtiger.diagnostic_build(): self.skipTest('requires a diagnostic build') # Close explicitly, there's going to be a fallure. diff --git a/test/suite/test_txn06.py b/test/suite/test_txn06.py index 4d1616084fe..0d3bf79c499 100644 --- a/test/suite/test_txn06.py +++ b/test/suite/test_txn06.py @@ -29,10 +29,9 @@ # Transactions: test long-running snapshots from suite_subprocess import suite_subprocess -from wiredtiger import wiredtiger_open from wtscenario import multiply_scenarios, number_scenarios from helper import simple_populate -import wttest +import wiredtiger, wttest class test_txn06(wttest.WiredTigerTestCase, suite_subprocess): conn_config = 'verbose=[transaction]' @@ -41,10 +40,10 @@ class test_txn06(wttest.WiredTigerTestCase, suite_subprocess): source_uri = 'table:' + tablename + "_src" nrows = 100000 - def setupConnection(*args): - if not self.conn.verbose_build(): + def setUpConnectionOpen(self, *args): + if not wiredtiger.verbose_build(): self.skipTest('requires a verbose build') - super(wttest.WiredTigerTestCase, setupConnection)(*args) + super(wttest.WiredTigerTestCase, setUpConnectionOpen)(self, *args) def test_long_running(self): # Populate a table |