summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Bolsterlee <uws@xs4all.nl>2013-06-07 23:07:17 +0200
committerWouter Bolsterlee <uws@xs4all.nl>2013-06-07 23:07:17 +0200
commitf789d0194b2e75264c0d31eb832288f72469d914 (patch)
tree1abe2b992aa5a3e3baaa87cb75c2c7c2f54c96c6
parent28c0bcdcea9056298229efe06ffd90bc4265bdef (diff)
parenta86a6ffc7e9b70e85d8192bbf5280366aa8936f6 (diff)
downloadhappybase-f789d0194b2e75264c0d31eb832288f72469d914.tar.gz
Delete test table from previous test run before running tests
-rw-r--r--tests/test_api.py10
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,