diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-09-16 16:16:17 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-16 16:16:17 +1000 |
commit | 03bbd9d3c9330a5b6e3cbd7d2db1ac7fea5e96bf (patch) | |
tree | f0d12b535fee95b721d8d046c3e4dfbfec0a91e2 /test | |
parent | d318b8a5370f7182beeab4124cee04fdce271608 (diff) | |
download | mongo-03bbd9d3c9330a5b6e3cbd7d2db1ac7fea5e96bf.tar.gz |
WT-2916 Fix and simplify s_whitespace. (#3047)
Diffstat (limited to 'test')
70 files changed, 4 insertions, 99 deletions
diff --git a/test/csuite/wt2246_col_append/main.c b/test/csuite/wt2246_col_append/main.c index 69683707d16..b795816c76f 100644 --- a/test/csuite/wt2246_col_append/main.c +++ b/test/csuite/wt2246_col_append/main.c @@ -111,7 +111,7 @@ main(int argc, char *argv[]) testutil_check(testutil_parse_opts(argc, argv, opts)); testutil_make_work_dir(opts->home); - snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), "create," "cache_size=%s," "eviction=(threads_max=5)," diff --git a/test/format/config.c b/test/format/config.c index 1b09916bd88..542adf33da2 100644 --- a/test/format/config.c +++ b/test/format/config.c @@ -796,7 +796,7 @@ config_find(const char *s, size_t len) { CONFIG *cp; - for (cp = c; cp->name != NULL; ++cp) + for (cp = c; cp->name != NULL; ++cp) if (strncmp(s, cp->name, len) == 0 && cp->name[len] == '\0') return (cp); diff --git a/test/format/config.h b/test/format/config.h index 6e3f5473479..725bc7c5d97 100644 --- a/test/format/config.h +++ b/test/format/config.h @@ -37,7 +37,7 @@ typedef struct { /* Value is a boolean, yes if roll of 1-to-100 is <= CONFIG->min. */ #define C_BOOL 0x001 - /* Not a simple randomization, handle outside the main loop. */ + /* Not a simple randomization, handle outside the main loop. */ #define C_IGNORE 0x002 /* Value was set from command-line or file, ignore for all runs. */ diff --git a/test/format/format.h b/test/format/format.h index 047be552308..363dcf9eea8 100644 --- a/test/format/format.h +++ b/test/format/format.h @@ -202,7 +202,7 @@ typedef struct { uint32_t c_verify; uint32_t c_write_pct; -#define FIX 1 +#define FIX 1 #define ROW 2 #define VAR 3 u_int type; /* File type's flag value */ diff --git a/test/suite/test_async01.py b/test/suite/test_async01.py index 9322748c30f..cbb3dad8de6 100644 --- a/test/suite/test_async01.py +++ b/test/suite/test_async01.py @@ -107,7 +107,6 @@ class Callback(wiredtiger.AsyncCallback): return 0 - # test_async01.py # Async operations # Basic smoke-test of file and table async ops: tests get/set key, insert @@ -261,6 +260,5 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess): self.assertTrue(callback.nupdate == self.nentries) self.assertTrue(callback.nerror == 0) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_async02.py b/test/suite/test_async02.py index bc6b389fc27..50652da6dfd 100644 --- a/test/suite/test_async02.py +++ b/test/suite/test_async02.py @@ -104,7 +104,6 @@ class Callback(wiredtiger.AsyncCallback): return 0 - # test_async02.py # Async operations # Basic smoke-test of file and table async ops: tests get/set key, insert @@ -219,6 +218,5 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess): # Make sure all callbacks went according to plan. self.assertTrue(callback.nerror == 0) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_async03.py b/test/suite/test_async03.py index 41939bb578a..98851885f70 100644 --- a/test/suite/test_async03.py +++ b/test/suite/test_async03.py @@ -36,7 +36,6 @@ class Callback(wiredtiger.AsyncCallback): def notify(self, op, op_ret, flags): raise AssertionError('callback should not be called in this test') - # test_async03.py # Async operations # Try to run async code with an incorrect connection config. diff --git a/test/suite/test_backup03.py b/test/suite/test_backup03.py index 053009c6edb..ba7ce60f519 100644 --- a/test/suite/test_backup03.py +++ b/test/suite/test_backup03.py @@ -149,6 +149,5 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess): self.populate() self.backup_table_cursor(self.list) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_backup04.py b/test/suite/test_backup04.py index 866e673dccb..dd4dbc1d60f 100644 --- a/test/suite/test_backup04.py +++ b/test/suite/test_backup04.py @@ -171,6 +171,5 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess): self.compare(self.uri, full_dir, self.dir) self.compare(self.uri, None, self.dir) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_backup05.py b/test/suite/test_backup05.py index 131732e9a89..4ecb782a0d5 100644 --- a/test/suite/test_backup05.py +++ b/test/suite/test_backup05.py @@ -80,7 +80,6 @@ class test_backup05(wttest.WiredTigerTestCase, suite_subprocess): self.session.drop(self.emptyuri, None) self.session.create(self.emptyuri, self.create_params) - # Open the new directory and verify conn = self.setUpConnectionOpen(newdir) session = self.setUpSessionOpen(conn) diff --git a/test/suite/test_bug001.py b/test/suite/test_bug001.py index 79ade05d2c7..4c4a722285c 100644 --- a/test/suite/test_bug001.py +++ b/test/suite/test_bug001.py @@ -100,7 +100,6 @@ class test_bug001(wttest.WiredTigerTestCase): self.assertEquals(cursor.close(), 0) self.session.drop(uri) - # Test a bug where cursor remove inside implicit records looped infinitely. def test_implicit_record_cursor_remove(self): uri='file:xxx' @@ -149,6 +148,5 @@ class test_bug001(wttest.WiredTigerTestCase): self.assertEquals(cursor.close(), 0) self.session.drop(uri) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug003.py b/test/suite/test_bug003.py index 28d71a534e2..73d9cd13ab9 100644 --- a/test/suite/test_bug003.py +++ b/test/suite/test_bug003.py @@ -54,6 +54,5 @@ class test_bug003(wttest.WiredTigerTestCase): self.session.checkpoint() cursor = self.session.open_cursor(self.uri, None, "bulk") - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug004.py b/test/suite/test_bug004.py index a8b9a0a0dde..316d15d8080 100644 --- a/test/suite/test_bug004.py +++ b/test/suite/test_bug004.py @@ -90,6 +90,5 @@ class test_bug004(wttest.WiredTigerTestCase): self.assertEquals( c1.get_value(), value_populate(c1, i) + 'abcdef' * 100) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug005.py b/test/suite/test_bug005.py index 6e888c3b00b..6437b329096 100644 --- a/test/suite/test_bug005.py +++ b/test/suite/test_bug005.py @@ -59,6 +59,5 @@ class test_bug005(wttest.WiredTigerTestCase): # Verify the object again. self.session.verify(self.uri) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug006.py b/test/suite/test_bug006.py index 314ba57038f..e01333f59de 100644 --- a/test/suite/test_bug006.py +++ b/test/suite/test_bug006.py @@ -74,6 +74,5 @@ class test_bug006(wttest.WiredTigerTestCase): self.session.drop(uri, None) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug007.py b/test/suite/test_bug007.py index 1add6512df3..16cb5da903c 100644 --- a/test/suite/test_bug007.py +++ b/test/suite/test_bug007.py @@ -56,6 +56,5 @@ class test_bug007(wttest.WiredTigerTestCase): # Forced salvage should succeed. self.session.salvage(uri, "force") - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug008.py b/test/suite/test_bug008.py index c4fa411f55e..8e787ae14d1 100644 --- a/test/suite/test_bug008.py +++ b/test/suite/test_bug008.py @@ -297,6 +297,5 @@ class test_bug008(wttest.WiredTigerTestCase): self.assertEqual(cursor.get_key(), key_populate(cursor, 119)) self.assertEqual(cursor.get_value(), value_populate(cursor, 119)) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bug016.py b/test/suite/test_bug016.py index f7cb3c32559..4b8867e1e93 100644 --- a/test/suite/test_bug016.py +++ b/test/suite/test_bug016.py @@ -104,6 +104,5 @@ class test_bug016(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: cursor.get_key(), "/requires key be set/") - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bulk01.py b/test/suite/test_bulk01.py index 5bacfafaa20..addebe80647 100644 --- a/test/suite/test_bulk01.py +++ b/test/suite/test_bulk01.py @@ -214,6 +214,5 @@ class test_bulk_load(wttest.WiredTigerTestCase): self.assertRaises(wiredtiger.WiredTigerError, lambda: self.session.open_cursor(uri, None, "bulk")) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_bulk02.py b/test/suite/test_bulk02.py index af0b6d4485d..c959098179c 100644 --- a/test/suite/test_bulk02.py +++ b/test/suite/test_bulk02.py @@ -126,6 +126,5 @@ class test_bulkload_backup(wttest.WiredTigerTestCase, suite_subprocess): else: self.check_backup(self.conn.open_session()) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py index 78754dc82fa..013cda96e4e 100644 --- a/test/suite/test_checkpoint01.py +++ b/test/suite/test_checkpoint01.py @@ -136,7 +136,6 @@ class test_checkpoint(wttest.WiredTigerTestCase): (self.checkpoints[checkpoint_name][0], 0) self.check() - # Check some specific cursor checkpoint combinations. class test_checkpoint_cursor(wttest.WiredTigerTestCase): scenarios = make_scenarios([ @@ -202,7 +201,6 @@ class test_checkpoint_cursor(wttest.WiredTigerTestCase): self.session.checkpoint("drop=(checkpoint-2)") self.session.checkpoint("drop=(from=all)") - # Check that you can checkpoint targets. class test_checkpoint_target(wttest.WiredTigerTestCase): scenarios = make_scenarios([ @@ -249,7 +247,6 @@ class test_checkpoint_target(wttest.WiredTigerTestCase): self.check(self.uri + '2', 'UPDATE') self.check(self.uri + '3', 'ORIGINAL') - # Check that you can't write checkpoint cursors. class test_checkpoint_cursor_update(wttest.WiredTigerTestCase): scenarios = make_scenarios([ @@ -274,7 +271,6 @@ class test_checkpoint_cursor_update(wttest.WiredTigerTestCase): lambda: cursor.update(), msg) cursor.close() - # Check that WiredTigerCheckpoint works as a checkpoint specifier. class test_checkpoint_last(wttest.WiredTigerTestCase): scenarios = make_scenarios([ @@ -306,7 +302,6 @@ class test_checkpoint_last(wttest.WiredTigerTestCase): # Don't close the checkpoint cursor, we want it to remain open until # the test completes. - # Check we can't use the reserved name as an application checkpoint name. class test_checkpoint_illegal_name(wttest.WiredTigerTestCase): def test_checkpoint_illegal_name(self): @@ -331,7 +326,6 @@ class test_checkpoint_illegal_name(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.checkpoint(conf), msg) - # Check we can't name checkpoints that include LSM tables. class test_checkpoint_lsm_name(wttest.WiredTigerTestCase): def test_checkpoint_lsm_name(self): @@ -341,7 +335,6 @@ class test_checkpoint_lsm_name(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.checkpoint("name=ckpt"), msg) - class test_checkpoint_empty(wttest.WiredTigerTestCase): scenarios = make_scenarios([ ('file', dict(uri='file:checkpoint')), @@ -417,6 +410,5 @@ class test_checkpoint_empty(wttest.WiredTigerTestCase): self.uri, None, "checkpoint=WiredTigerCheckpoint") self.assertEquals(cursor.next(), wiredtiger.WT_NOTFOUND) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_checkpoint02.py b/test/suite/test_checkpoint02.py index ac57499a9e4..0d166544472 100644 --- a/test/suite/test_checkpoint02.py +++ b/test/suite/test_checkpoint02.py @@ -84,6 +84,5 @@ class test_checkpoint02(wttest.WiredTigerTestCase): self.assertEqual(i, self.nops) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_colgap.py b/test/suite/test_colgap.py index 5cc363dbd4a..dbe748ae58f 100644 --- a/test/suite/test_colgap.py +++ b/test/suite/test_colgap.py @@ -119,7 +119,6 @@ class test_column_store_gap(wttest.WiredTigerTestCase): self.forward(cursor, v) self.backward(cursor, list(reversed(v))) - # Basic testing of variable-length column-store with big records. class test_colmax(wttest.WiredTigerTestCase): name = 'test_colmax' @@ -204,6 +203,5 @@ class test_colmax(wttest.WiredTigerTestCase): cursor.set_key(key_populate(cursor, recno)) self.assertEqual(cursor.search(), wiredtiger.WT_NOTFOUND) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_collator.py b/test/suite/test_collator.py index a8103fb3671..3fae4ff47cb 100644 --- a/test/suite/test_collator.py +++ b/test/suite/test_collator.py @@ -155,6 +155,5 @@ class test_collator(wttest.WiredTigerTestCase): self.create_indices() self.check_entries() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_compact01.py b/test/suite/test_compact01.py index 183d75f9d31..861e957d18d 100644 --- a/test/suite/test_compact01.py +++ b/test/suite/test_compact01.py @@ -100,6 +100,5 @@ class test_compact(wttest.WiredTigerTestCase, suite_subprocess): self.assertLess(stat_cursor[stat.dsrc.btree_row_leaf][2], self.maxpages) stat_cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_compact02.py b/test/suite/test_compact02.py index eb21817bd90..fe31aa1cbe1 100644 --- a/test/suite/test_compact02.py +++ b/test/suite/test_compact02.py @@ -147,6 +147,5 @@ class test_compact02(wttest.WiredTigerTestCase): # After compact, the file size should be less than half the full size. self.assertLess(sz, self.fullsize / 2) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_compress01.py b/test/suite/test_compress01.py index 2a7e2a7e1a8..606f7b63235 100644 --- a/test/suite/test_compress01.py +++ b/test/suite/test_compress01.py @@ -101,6 +101,5 @@ class test_compress01(wttest.WiredTigerTestCase): self.assertEquals(cursor.get_value(), `idx` + "abcdefg") cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_config06.py b/test/suite/test_config06.py index d426bfe2de9..55619e8774c 100644 --- a/test/suite/test_config06.py +++ b/test/suite/test_config06.py @@ -88,6 +88,5 @@ class test_config06(wttest.WiredTigerTestCase): cursor[k] = v self.assertEquals(cursor[k[:1]], v[:1]) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_cursor02.py b/test/suite/test_cursor02.py index a83d30def47..0771a275cd2 100644 --- a/test/suite/test_cursor02.py +++ b/test/suite/test_cursor02.py @@ -150,6 +150,5 @@ class test_cursor02(TestCursorTracker): self.cur_check_forward(cursor, -1) cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_cursor_compare.py b/test/suite/test_cursor_compare.py index 179e20682d2..4610a2f30a9 100644 --- a/test/suite/test_cursor_compare.py +++ b/test/suite/test_cursor_compare.py @@ -241,6 +241,5 @@ class test_cursor_comparison(wttest.WiredTigerTestCase): self.assertRaisesWithMessage( wiredtiger.WiredTigerError, lambda: cX.equals(c1), msg) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_cursor_pin.py b/test/suite/test_cursor_pin.py index 1aea49c32b0..b6119a93897 100644 --- a/test/suite/test_cursor_pin.py +++ b/test/suite/test_cursor_pin.py @@ -114,6 +114,5 @@ class test_cursor_pin(wttest.WiredTigerTestCase): list(range(self.nentries + 1, self.nentries + 1000) +\ range(self.nentries + 2001, self.nentries + 3000))) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py index 8d7c230043b..205b9c3c9c5 100644 --- a/test/suite/test_cursor_random.py +++ b/test/suite/test_cursor_random.py @@ -147,7 +147,6 @@ class test_cursor_random_column(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.open_cursor(self.uri, None, "next_random=true"), msg) - # Check next_random works in the presence a set of updates, some or all of # which are invisible to the cursor. class test_cursor_random_invisible(wttest.WiredTigerTestCase): @@ -217,6 +216,5 @@ class test_cursor_random_invisible(wttest.WiredTigerTestCase): self.assertEquals(cursor.next(), 0) self.assertEqual(cursor.get_key(), key_populate(cursor, 99)) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_encrypt01.py b/test/suite/test_encrypt01.py index d48605aaa83..d314cbeadfd 100644 --- a/test/suite/test_encrypt01.py +++ b/test/suite/test_encrypt01.py @@ -138,6 +138,5 @@ class test_encrypt01(wttest.WiredTigerTestCase): self.assertEquals(cursor.get_value(), val) cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_encrypt03.py b/test/suite/test_encrypt03.py index 0dc1755d6eb..cf459190637 100644 --- a/test/suite/test_encrypt03.py +++ b/test/suite/test_encrypt03.py @@ -97,6 +97,5 @@ class test_encrypt03(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.create(self.uri, params), msg) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_encrypt04.py b/test/suite/test_encrypt04.py index 97d2cee03a0..a244cf97961 100644 --- a/test/suite/test_encrypt04.py +++ b/test/suite/test_encrypt04.py @@ -230,6 +230,5 @@ class test_encrypt04(wttest.WiredTigerTestCase, suite_subprocess): cursor.close() self.assertEqual(self.expect_forceerror, self.got_forceerror) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_encrypt06.py b/test/suite/test_encrypt06.py index 9300583d099..893c4ba3095 100644 --- a/test/suite/test_encrypt06.py +++ b/test/suite/test_encrypt06.py @@ -128,7 +128,6 @@ class test_encrypt06(wttest.WiredTigerTestCase): else: return ',encryption=(name=' + name + args + ')' - def match_string_in_file(self, fname, match): with open(fname, 'rb') as f: return (f.read().find(match) != -1) @@ -223,6 +222,5 @@ class test_encrypt06(wttest.WiredTigerTestCase): self.assertEqual(self.expected_encryption(self.encrypt1), not self.match_string_in_rundir(txt1)) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_excl.py b/test/suite/test_excl.py index cea5756dfbb..f8628d96ff7 100644 --- a/test/suite/test_excl.py +++ b/test/suite/test_excl.py @@ -44,6 +44,5 @@ class test_create_excl(wttest.WiredTigerTestCase): self.assertRaises(wiredtiger.WiredTigerError, lambda: self.session.create(uri, "exclusive")) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_home.py b/test/suite/test_home.py index 2cdcf2429af..48bf10d7618 100644 --- a/test/suite/test_home.py +++ b/test/suite/test_home.py @@ -43,7 +43,6 @@ class test_isnew(wttest.WiredTigerTestCase): self.conn = self.setUpConnectionOpen(".") self.assertEquals(self.conn.is_new(), False) - # test_gethome # database get-home method class test_gethome(wttest.WiredTigerTestCase): @@ -60,7 +59,6 @@ class test_gethome(wttest.WiredTigerTestCase): self.conn = self.setUpConnectionOpen(name) self.assertEquals(self.conn.get_home(), name) - # test_base_config # test base configuration file config. class test_base_config(wttest.WiredTigerTestCase): @@ -74,6 +72,5 @@ class test_base_config(wttest.WiredTigerTestCase): self.assertFalse(os.path.exists("A/WiredTiger.basecfg")) conn.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_huffman01.py b/test/suite/test_huffman01.py index be307550f2e..8a880f7bae7 100644 --- a/test/suite/test_huffman01.py +++ b/test/suite/test_huffman01.py @@ -72,7 +72,6 @@ class test_huffman01(wttest.WiredTigerTestCase, suite_subprocess): config=self.huffkey + self.huffval self.session.create(self.table_name, config) - # Test Huffman encoding ranges. class test_huffman_range(wttest.WiredTigerTestCase): table_name = 'table:test_huff' @@ -123,6 +122,5 @@ class test_huffman_range(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.create(self.table_name, config), msg) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_join03.py b/test/suite/test_join03.py index af19d934d70..edab7146a6b 100644 --- a/test/suite/test_join03.py +++ b/test/suite/test_join03.py @@ -152,6 +152,5 @@ class test_join03(wttest.WiredTigerTestCase): for csvformat in [ 'SS', 'ii', 'Si', 'iS' ]: self.join(csvformat, '', extraargs) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_join04.py b/test/suite/test_join04.py index b270cb7a21c..a71418d9f05 100644 --- a/test/suite/test_join04.py +++ b/test/suite/test_join04.py @@ -163,6 +163,5 @@ class test_join04(wttest.WiredTigerTestCase): for c in cursors: c.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_join08.py b/test/suite/test_join08.py index d389fad706b..d344653717b 100644 --- a/test/suite/test_join08.py +++ b/test/suite/test_join08.py @@ -259,6 +259,5 @@ class test_join08(wttest.WiredTigerTestCase): jcursor.close() cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_jsondump02.py b/test/suite/test_jsondump02.py index 50931f0f5e6..8482851fb94 100644 --- a/test/suite/test_jsondump02.py +++ b/test/suite/test_jsondump02.py @@ -398,6 +398,5 @@ class test_jsondump02(wttest.WiredTigerTestCase, suite_subprocess): self.session.drop(self.table_uri5) self.session.drop(self.table_uri6) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_metadata_cursor01.py b/test/suite/test_metadata_cursor01.py index 7802f89f174..284e26bc936 100644 --- a/test/suite/test_metadata_cursor01.py +++ b/test/suite/test_metadata_cursor01.py @@ -83,7 +83,6 @@ class test_metadata_cursor01(wttest.WiredTigerTestCase): self.session_create(tablearg, create_args) self.pr('creating cursor') - # Forward iteration. def test_forward_iter(self): self.create_table() diff --git a/test/suite/test_overwrite.py b/test/suite/test_overwrite.py index 4972a016bec..b7af1612243 100644 --- a/test/suite/test_overwrite.py +++ b/test/suite/test_overwrite.py @@ -135,6 +135,5 @@ class test_overwrite(wttest.WiredTigerTestCase): cursor.set_value('XXXXXXXXXX') self.assertEquals(cursor.update(), 0) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_readonly03.py b/test/suite/test_readonly03.py index d9930e8f553..a5607fcfe80 100644 --- a/test/suite/test_readonly03.py +++ b/test/suite/test_readonly03.py @@ -57,7 +57,6 @@ class test_readonly03(wttest.WiredTigerTestCase, suite_subprocess): self.create = False return conn - def test_readonly(self): create_params = 'key_format=i,value_format=i' entries = 10 diff --git a/test/suite/test_rebalance.py b/test/suite/test_rebalance.py index 98bd81de602..acb73d82a13 100644 --- a/test/suite/test_rebalance.py +++ b/test/suite/test_rebalance.py @@ -76,6 +76,5 @@ class test_rebalance(wttest.WiredTigerTestCase): self.rebalance(complex_populate, False) self.rebalance(complex_populate, True) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_schema02.py b/test/suite/test_schema02.py index bccc7dfc728..ffe710b7d3e 100644 --- a/test/suite/test_schema02.py +++ b/test/suite/test_schema02.py @@ -279,6 +279,5 @@ class test_schema02(wttest.WiredTigerTestCase): self.populate() self.check_entries() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py index 81556393e78..e5a6528914a 100644 --- a/test/suite/test_schema03.py +++ b/test/suite/test_schema03.py @@ -151,7 +151,6 @@ class tabconfig: idx.formats += self.valueformats[colno - self.nkeys] prob *= 0.5 - class cgconfig: """ Configuration for a column group used in the test. diff --git a/test/suite/test_schema04.py b/test/suite/test_schema04.py index 8ac81690819..63c638b916c 100644 --- a/test/suite/test_schema04.py +++ b/test/suite/test_schema04.py @@ -122,6 +122,5 @@ class test_schema04(wttest.WiredTigerTestCase): self.create_indices() self.check_entries() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_schema05.py b/test/suite/test_schema05.py index 89484cfc7bd..28ad51b3c92 100644 --- a/test/suite/test_schema05.py +++ b/test/suite/test_schema05.py @@ -169,6 +169,5 @@ class test_schema05(wttest.WiredTigerTestCase): self.create_indices() self.check_entries() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_stat02.py b/test/suite/test_stat02.py index ef3907e54b1..3d2a83d1c3c 100644 --- a/test/suite/test_stat02.py +++ b/test/suite/test_stat02.py @@ -78,7 +78,6 @@ class test_stat_cursor_config(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.open_cursor('statistics:', None, config), msg) - # Test the connection "clear" configuration. class test_stat_cursor_conn_clear(wttest.WiredTigerTestCase): pfx = 'test_stat_cursor_conn_clear' @@ -99,7 +98,6 @@ class test_stat_cursor_conn_clear(wttest.WiredTigerTestCase): self.assertGreater(cursor[stat.conn.cache_bytes_dirty][2], 0) self.assertEqual(cursor[stat.conn.cursor_insert][2], 0) - # Test the data-source "clear" configuration. class test_stat_cursor_dsrc_clear(wttest.WiredTigerTestCase): pfx = 'test_stat_cursor_dsrc_clear' @@ -129,7 +127,6 @@ class test_stat_cursor_dsrc_clear(wttest.WiredTigerTestCase): 'statistics:' + self.uri, None, 'statistics=(all,clear)') self.assertEqual(cursor[stat.dsrc.cursor_insert][2], 0) - # Test the "fast" configuration. class test_stat_cursor_fast(wttest.WiredTigerTestCase): pfx = 'test_stat_cursor_fast' @@ -157,7 +154,6 @@ class test_stat_cursor_fast(wttest.WiredTigerTestCase): 'statistics:' + self.uri, None, 'statistics=(all)') self.assertGreater(cursor[stat.dsrc.btree_entries][2], 0) - # Test connection error combinations. class test_stat_cursor_conn_error(wttest.WiredTigerTestCase): def setUpConnectionOpen(self, dir): @@ -173,7 +169,6 @@ class test_stat_cursor_conn_error(wttest.WiredTigerTestCase): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.wiredtiger_open('.', config), msg) - # Test data-source error combinations. class test_stat_cursor_dsrc_error(wttest.WiredTigerTestCase): pfx = 'test_stat_cursor_dsrc_error' @@ -198,6 +193,5 @@ class test_stat_cursor_dsrc_error(wttest.WiredTigerTestCase): lambda: self.session.open_cursor( 'statistics:' + self.uri, None, config), msg) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_stat03.py b/test/suite/test_stat03.py index b17fe6eb91c..1570ac4c9d8 100644 --- a/test/suite/test_stat03.py +++ b/test/suite/test_stat03.py @@ -99,6 +99,5 @@ class test_stat_cursor_reset(wttest.WiredTigerTestCase): self.assertEqual(statc[stat.dsrc.btree_entries][2], n) statc.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_truncate01.py b/test/suite/test_truncate01.py index 9a3518c6984..37cd1f12c79 100644 --- a/test/suite/test_truncate01.py +++ b/test/suite/test_truncate01.py @@ -76,7 +76,6 @@ class test_truncate_arguments(wttest.WiredTigerTestCase): c1.close() c2.close() - # Test truncation of an object using its URI. class test_truncate_uri(wttest.WiredTigerTestCase): name = 'test_truncate' @@ -101,7 +100,6 @@ class test_truncate_uri(wttest.WiredTigerTestCase): confirm_empty(self, uri) self.session.drop(uri, None) - # Test truncation of cursors in an illegal order. class test_truncate_cursor_order(wttest.WiredTigerTestCase): name = 'test_truncate' @@ -132,7 +130,6 @@ class test_truncate_cursor_order(wttest.WiredTigerTestCase): c2.set_key(key_populate(c2, 20)) self.session.truncate(None, c1, c2, None) - # Test truncation of cursors past the end of the object. class test_truncate_cursor_end(wttest.WiredTigerTestCase): name = 'test_truncate' @@ -174,7 +171,6 @@ class test_truncate_cursor_end(wttest.WiredTigerTestCase): self.assertEquals(c2.close(), 0) self.session.drop(uri) - # Test session.truncate. class test_truncate_cursor(wttest.WiredTigerTestCase): name = 'test_truncate' @@ -447,6 +443,5 @@ class test_truncate_cursor(wttest.WiredTigerTestCase): self.truncateRangeAndCheck(uri, begin, end, expected) self.session.drop(uri, None) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_truncate02.py b/test/suite/test_truncate02.py index e57a65d2f97..7184cd67242 100644 --- a/test/suite/test_truncate02.py +++ b/test/suite/test_truncate02.py @@ -204,6 +204,5 @@ class test_truncate_fast_delete(wttest.WiredTigerTestCase): self.cursor_count(cursor, self.nentries) cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_truncate03.py b/test/suite/test_truncate03.py index e2db355f0ef..49044ac5690 100644 --- a/test/suite/test_truncate03.py +++ b/test/suite/test_truncate03.py @@ -135,6 +135,5 @@ class test_truncate_address_deleted(wttest.WiredTigerTestCase): self.assertEqual(cursor.get_value(), v) self.assertEqual(cursor.close(), 0) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_txn01.py b/test/suite/test_txn01.py index 1ba74461088..d4ca2ac8d12 100644 --- a/test/suite/test_txn01.py +++ b/test/suite/test_txn01.py @@ -131,7 +131,6 @@ class test_txn01(wttest.WiredTigerTestCase): self.session.commit_transaction() self.check(cursor, self.nentries, self.nentries) - # Test that read-committed is the default isolation level. class test_read_committed_default(wttest.WiredTigerTestCase): uri = 'table:test_txn' @@ -162,6 +161,5 @@ class test_read_committed_default(wttest.WiredTigerTestCase): s.commit_transaction() s.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_txn11.py b/test/suite/test_txn11.py index ab87283c014..dfb02799434 100644 --- a/test/suite/test_txn11.py +++ b/test/suite/test_txn11.py @@ -62,7 +62,6 @@ class test_txn11(wttest.WiredTigerTestCase, suite_subprocess): checkpoints += 1 return - def test_ops(self): # Populate a table simple_populate(self, self.source_uri, 'key_format=S', self.nrows) diff --git a/test/suite/test_upgrade.py b/test/suite/test_upgrade.py index e4f92f8f8d8..1c2e3f6cda8 100644 --- a/test/suite/test_upgrade.py +++ b/test/suite/test_upgrade.py @@ -67,6 +67,5 @@ class test_upgrade(wttest.WiredTigerTestCase): self.upgrade(complex_populate, False) self.upgrade(complex_populate, True) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util01.py b/test/suite/test_util01.py index 726a53eb5ca..5795bb5b2e6 100644 --- a/test/suite/test_util01.py +++ b/test/suite/test_util01.py @@ -183,6 +183,5 @@ class test_util01(wttest.WiredTigerTestCase, suite_subprocess): def test_dump_api_hex(self): self.dump(True, True) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util02.py b/test/suite/test_util02.py index 421b0104484..13f52d6aeea 100644 --- a/test/suite/test_util02.py +++ b/test/suite/test_util02.py @@ -162,7 +162,6 @@ class test_util02(wttest.WiredTigerTestCase, suite_subprocess): def test_load_process_hex(self): self.load_process(True) - # test_load_commandline -- # Test the command-line processing. class test_load_commandline(wttest.WiredTigerTestCase, suite_subprocess): @@ -220,6 +219,5 @@ class test_load_commandline(wttest.WiredTigerTestCase, suite_subprocess): self.load_commandline(["table", "source=bar"], False) self.load_commandline(["table", "version=(100,200)"], False) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util03.py b/test/suite/test_util03.py index e341c79ff9e..ac93d04f799 100644 --- a/test/suite/test_util03.py +++ b/test/suite/test_util03.py @@ -69,6 +69,5 @@ class test_util03(wttest.WiredTigerTestCase, suite_subprocess): self.fail('table should be empty') cursor.close() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util07.py b/test/suite/test_util07.py index 602ddbba5ff..1175ad8eb13 100644 --- a/test/suite/test_util07.py +++ b/test/suite/test_util07.py @@ -93,6 +93,5 @@ class test_util07(wttest.WiredTigerTestCase, suite_subprocess): self.check_empty_file(outfile) self.check_file_contains(errfile, 'key49: not found\n') - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util08.py b/test/suite/test_util08.py index b2bb1e067e0..456b68675c6 100644 --- a/test/suite/test_util08.py +++ b/test/suite/test_util08.py @@ -42,6 +42,5 @@ class test_util08(wttest.WiredTigerTestCase, suite_subprocess): text = f.read(1000) self.assertTrue('Copyright' in text) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util09.py b/test/suite/test_util09.py index ddf01b980ea..4b514401478 100644 --- a/test/suite/test_util09.py +++ b/test/suite/test_util09.py @@ -100,6 +100,5 @@ class test_util09(wttest.WiredTigerTestCase, suite_subprocess): self.runWt(["loadtext", "table:" + self.tablename], infilename="loadtext.in") self.check_keys(self.tablename, keys) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util11.py b/test/suite/test_util11.py index 6bf87525164..d5d1cda8c39 100644 --- a/test/suite/test_util11.py +++ b/test/suite/test_util11.py @@ -128,6 +128,5 @@ class test_util11(wttest.WiredTigerTestCase, suite_subprocess): self.runWt(["list"], outfilename=outfile) self.check_file_content(outfile, filelist) - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_util12.py b/test/suite/test_util12.py index f407c2ce7d6..3821139f266 100644 --- a/test/suite/test_util12.py +++ b/test/suite/test_util12.py @@ -86,6 +86,5 @@ class test_util12(wttest.WiredTigerTestCase, suite_subprocess): 'def', '456', 'abc'], errfilename=errfile, failure=True) self.check_file_contains(errfile, 'usage:') - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_verify.py b/test/suite/test_verify.py index 28a66415b9d..46ae667464a 100644 --- a/test/suite/test_verify.py +++ b/test/suite/test_verify.py @@ -197,6 +197,5 @@ class test_verify(wttest.WiredTigerTestCase, suite_subprocess): errfilename="verifyerr.out", failure=True) self.check_non_empty_file("verifyerr.out") - if __name__ == '__main__': wttest.run() diff --git a/test/suite/test_version.py b/test/suite/test_version.py index f8835e5bd05..569f181acda 100644 --- a/test/suite/test_version.py +++ b/test/suite/test_version.py @@ -36,6 +36,5 @@ class test_version(wttest.WiredTigerTestCase): def test_version(self): version = wiredtiger.wiredtiger_version() - if __name__ == '__main__': wttest.run() diff --git a/test/suite/wttest.py b/test/suite/wttest.py index 086feb02bc0..4d6df0bc8bd 100644 --- a/test/suite/wttest.py +++ b/test/suite/wttest.py @@ -134,7 +134,6 @@ class CapturedFd(object): gotstr + '"') self.expectpos = os.path.getsize(self.filename) - class TestSuiteConnection(object): def __init__(self, conn, connlist): connlist.append(conn) @@ -153,7 +152,6 @@ class TestSuiteConnection(object): else: return getattr(self._conn, attr) - class WiredTigerTestCase(unittest.TestCase): _globalSetup = False _printOnceSeen = {} @@ -524,7 +522,6 @@ class WiredTigerTestCase(unittest.TestCase): def className(self): return self.__class__.__name__ - def longtest(description): """ Used as a function decorator, for example, @wttest.longtest("description"). |