diff --git a/src/__init__.py b/src/__init__.py index bd7090c4..794ca89d 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -44,7 +44,8 @@ bound_ports, \ get_bin_path, \ get_pg_config, \ - get_pg_version + get_pg_version, \ + parse_pg_version from .standby import \ First, \ @@ -56,7 +57,7 @@ from testgres.operations.local_ops import LocalOperations from testgres.operations.remote_ops import RemoteOperations -__version__ = "1.14.3" +__version__ = "1.14.4" __all__ = [ "get_new_node", @@ -71,7 +72,7 @@ "NodeApp", "PostgresNode", "PortManager", - "reserve_port", "release_port", "bound_ports", "get_bin_path", "get_pg_config", "get_pg_version", + "reserve_port", "release_port", "bound_ports", "get_bin_path", "get_pg_config", "get_pg_version", "parse_pg_version", "First", "Any", "OsOperations", "LocalOperations", "RemoteOperations", "ConnectionParams" ] diff --git a/src/utils.py b/src/utils.py index 2496e532..5e9fa955 100644 --- a/src/utils.py +++ b/src/utils.py @@ -304,7 +304,8 @@ def parse_pg_version(version_out): version = raw_ver.split(' ')[-1] \ .partition('devel')[0] \ .partition('beta')[0] \ - .partition('rc')[0] + .partition('rc')[0] \ + .partition('-')[0] return version diff --git a/tests/test_testgres_common.py b/tests/test_testgres_common.py index 982249f2..8cc86432 100644 --- a/tests/test_testgres_common.py +++ b/tests/test_testgres_common.py @@ -96,7 +96,7 @@ def test_testgres_version(self): # Author: Mark G. assert v.major == 1 assert v.minor == 14 - assert v.micro == 3 + assert v.micro == 4 assert str(v) == testgres_version return diff --git a/tests/test_utils.py b/tests/test_utils.py index 9bb233b2..92505752 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -34,6 +34,9 @@ def test_parse_pg_version(self): assert parse_pg_version("postgres (PostgreSQL) 11.4") == "11.4" # Macos assert parse_pg_version("postgres (PostgreSQL) 14.9 (Homebrew)") == "14.9" + # Postgres Pro trial + assert parse_pg_version("postgres (PostgreSQL) 18.4-TRIAL") == "18.4" + assert parse_pg_version("PostgreSQL 18.4-TRIAL") == "18.4" def test_get_pg_config2(self, os_ops: OsOperations): assert isinstance(os_ops, OsOperations)