diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2013-06-07 23:07:17 +0200 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2013-06-07 23:07:17 +0200 |
commit | f789d0194b2e75264c0d31eb832288f72469d914 (patch) | |
tree | 1abe2b992aa5a3e3baaa87cb75c2c7c2f54c96c6 | |
parent | 28c0bcdcea9056298229efe06ffd90bc4265bdef (diff) | |
parent | a86a6ffc7e9b70e85d8192bbf5280366aa8936f6 (diff) | |
download | happybase-f789d0194b2e75264c0d31eb832288f72469d914.tar.gz |
Delete test table from previous test run before running tests
-rw-r--r-- | tests/test_api.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index 28a4623..c3c7022 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -43,12 +43,22 @@ connection_kwargs = dict( connection = table = None +def maybe_delete_table(): + if KEEP_TABLE: + return + + if TEST_TABLE_NAME in connection.tables(): + print "Test table already exists; removing it..." + connection.delete_table(TEST_TABLE_NAME, disable=True) + + def setup_module(): global connection, table connection = Connection(**connection_kwargs) assert_is_not_none(connection) + maybe_delete_table() cfs = { 'cf1': {}, 'cf2': None, |