]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- put exact version string in the test
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 29 Sep 2013 21:24:29 +0000 (17:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 29 Sep 2013 21:25:34 +0000 (17:25 -0400)
- use match with a .* preceding instead of search

lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_dialect.py

index 3e41d5fad5e907d199fe09eecc8d18c8ee4a8521..1c8a71fbd135119e35d0dcb0f9fc2c335c7a7bc5 100644 (file)
@@ -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:
index 7acc1e9ff729139a8bb2089f8c688248068749d5..3d48230f3404e4f95205b0faa9a05853fc340d65 100644 (file)
@@ -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)),