From aaac48e6973fc0b004c13822876fb60efae91448 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 26 Feb 2010 15:53:09 -0800 Subject: [PATCH] Reordered database droppage because the tests just got bitten by some old test databases that were kicking around on the test machine. --- tests/db_pool_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/db_pool_test.py b/tests/db_pool_test.py index 398708f..c0b1093 100644 --- a/tests/db_pool_test.py +++ b/tests/db_pool_test.py @@ -603,16 +603,17 @@ class Psycopg2ConnectionPool(object): super(Psycopg2ConnectionPool, self).tearDown() def create_db(self): + dbname = 'test%s' % os.getpid() + self._auth['database'] = dbname try: self.drop_db() except Exception: pass auth = self._auth.copy() + auth.pop('database') # can't create if you're connecting to it conn = self._dbmodule.connect(**auth) conn.set_isolation_level(0) db = conn.cursor() - dbname = 'test%s' % os.getpid() - self._auth['database'] = dbname db.execute("create database "+dbname) db.close() del db