Reordered database droppage because the tests just got bitten by some old test databases that were kicking around on the test machine.
This commit is contained in:
@@ -603,16 +603,17 @@ class Psycopg2ConnectionPool(object):
|
|||||||
super(Psycopg2ConnectionPool, self).tearDown()
|
super(Psycopg2ConnectionPool, self).tearDown()
|
||||||
|
|
||||||
def create_db(self):
|
def create_db(self):
|
||||||
|
dbname = 'test%s' % os.getpid()
|
||||||
|
self._auth['database'] = dbname
|
||||||
try:
|
try:
|
||||||
self.drop_db()
|
self.drop_db()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
auth = self._auth.copy()
|
auth = self._auth.copy()
|
||||||
|
auth.pop('database') # can't create if you're connecting to it
|
||||||
conn = self._dbmodule.connect(**auth)
|
conn = self._dbmodule.connect(**auth)
|
||||||
conn.set_isolation_level(0)
|
conn.set_isolation_level(0)
|
||||||
db = conn.cursor()
|
db = conn.cursor()
|
||||||
dbname = 'test%s' % os.getpid()
|
|
||||||
self._auth['database'] = dbname
|
|
||||||
db.execute("create database "+dbname)
|
db.execute("create database "+dbname)
|
||||||
db.close()
|
db.close()
|
||||||
del db
|
del db
|
||||||
|
Reference in New Issue
Block a user