From: Mike Bayer Date: Sat, 18 Aug 2007 21:43:53 +0000 (+0000) Subject: adding an "already exists" catch for CREATE DOMAIN X-Git-Tag: rel_0_4beta4~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f9b4bc42791a580d687df229f56bec9696478be;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git adding an "already exists" catch for CREATE DOMAIN --- diff --git a/test/dialect/postgres.py b/test/dialect/postgres.py index f80ddcadd6..221f7660a9 100644 --- a/test/dialect/postgres.py +++ b/test/dialect/postgres.py @@ -11,8 +11,12 @@ class DomainReflectionTest(AssertMixin): @testing.supported('postgres') def setUpAll(self): con = testbase.db.connect() - con.execute('CREATE DOMAIN testdomain INTEGER NOT NULL DEFAULT 42') - con.execute('CREATE DOMAIN alt_schema.testdomain INTEGER DEFAULT 0') + try: + con.execute('CREATE DOMAIN testdomain INTEGER NOT NULL DEFAULT 42') + con.execute('CREATE DOMAIN alt_schema.testdomain INTEGER DEFAULT 0') + except exceptions.SQLError, e: + if not "already exists" in str(e): + raise e con.execute('CREATE TABLE testtable (question integer, answer testdomain)') con.execute('CREATE TABLE alt_schema.testtable(question integer, answer alt_schema.testdomain, anything integer)') con.execute('CREATE TABLE crosschema (question integer, answer alt_schema.testdomain)')