From: Mike Bayer Date: Sun, 29 Sep 2013 21:24:29 +0000 (-0400) Subject: - put exact version string in the test X-Git-Tag: rel_0_8_3~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51c92e1132e48e453dda2297ffd891c8558d1d26;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - put exact version string in the test - use match with a .* preceding instead of search --- diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 3e41d5fad5..1c8a71fbd1 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1544,8 +1544,8 @@ class PGDialect(default.DefaultDialect): def _get_server_version_info(self, connection): v = connection.execute("select version()").scalar() - m = re.search( - '(?:PostgreSQL|EnterpriseDB) ' + m = re.match( + '.*(?:PostgreSQL|EnterpriseDB) ' '(\d+)\.(\d+)(?:\.(\d+))?(?:\.\d+)?(?:devel)?', v) if not m: diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 7acc1e9ff7..3d48230f34 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -54,9 +54,8 @@ class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL): ('EnterpriseDB 9.1.2.2 on x86_64-unknown-linux-gnu, ' 'compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50), ' '64-bit', (9, 1, 2)), - ('VMWare EnterpriseDB 9.1.2.2 on x86_64-unknown-linux-gnu, ' - 'compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50), ' - '64-bit', (9, 1, 2)) + ('[PostgreSQL 9.2.4 ] VMware vFabric Postgres 9.2.4.0 ' + 'release build 1080137', (9, 2, 4)) ]: eq_(testing.db.dialect._get_server_version_info(mock_conn(string)),