diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-09-29 17:24:29 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-09-29 17:24:29 -0400 |
commit | 94d421ca2f2d9f45b5feb4419a34b97a50b8d90b (patch) | |
tree | 853aca05d03f3fe013207f0444271dc6944f6340 | |
parent | fc8c40e8c58764f46aa794986c269789eb2b72b1 (diff) | |
download | sqlalchemy-94d421ca2f2d9f45b5feb4419a34b97a50b8d90b.tar.gz |
- put exact version string in the test
- use match with a .* preceding instead of search
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 4 | ||||
-rw-r--r-- | test/dialect/postgresql/test_dialect.py | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 01bf6a829..ecbbf1674 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1543,8 +1543,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 7acc1e9ff..3d48230f3 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)), |