Skip to content

Commit 2f16251

Browse files
committed
Fix PostgreSQL version detection
1 parent efc4fd7 commit 2f16251

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lib
1919
lib64
2020
.cache
2121
.pytest_cache
22+
venv/
2223

2324
# Installer logs
2425
pip-log.txt

CHANGES.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
unreleased
5+
----------
6+
7+
- [bugfix] Fix version detection, to allow for two-digit minor version part
8+
49
2.4.0
510
----------
611

src/pytest_postgresql/executor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PostgreSQLExecutor(TCPExecutor):
4949
"-l {logfile} {startparams}"
5050
))
5151

52-
VERSION_RE = re.compile(r'.* (?P<version>\d+\.\d)')
52+
VERSION_RE = re.compile(r'.* (?P<version>\d+\.\d+)')
5353
MIN_SUPPORTED_VERSION = parse_version('9.0')
5454

5555
def __init__(self, executable, host, port,

tests/test_version.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
('pg_ctl (PostgreSQL) 9.4.1', '9.4'),
1111
('pg_ctl (PostgreSQL) 10.0', '10.0'),
1212
('pg_ctl (PostgreSQL) 10.1', '10.1'),
13+
('pg_ctl (PostgreSQL) 10.13', '10.13'),
1314
))
1415
def test_versions(ctl_input, version):
1516
"""Check correctness of the version regexp."""

0 commit comments

Comments
 (0)