Skip to content

Commit d0d8c55

Browse files
authored
Merge pull request #456 from Adnuntius/jp_test_base_backup_some_test_not_executed_for_gt_96
due to a dodgy version comparison some of the base backup tests were …
2 parents 81d5ef2 + a0f4898 commit d0d8c55

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_basebackup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import tarfile
1010
import time
1111
from copy import deepcopy
12+
from distutils.version import LooseVersion
1213
from queue import Queue
1314
from subprocess import check_call
1415

@@ -367,17 +368,17 @@ def test_basebackups_local_tar_with_delta_stats(self, capsys, db, pghoard, tmpdi
367368
self._test_basebackups(capsys, db, pghoard, tmpdir, BaseBackupMode.local_tar_delta_stats)
368369

369370
def test_basebackups_local_tar_nonexclusive(self, capsys, db, pghoard, tmpdir):
370-
if db.pgver < "9.6":
371+
if LooseVersion(db.pgver) < "9.6":
371372
pytest.skip("PostgreSQL 9.6+ required for non-exclusive backups")
372373
self._test_basebackups(capsys, db, pghoard, tmpdir, BaseBackupMode.local_tar)
373374

374375
def test_basebackups_local_tar_legacy(self, capsys, db, pghoard, tmpdir):
375-
if db.pgver >= "9.6":
376+
if LooseVersion(db.pgver) >= "9.6":
376377
pytest.skip("PostgreSQL < 9.6 required for exclusive backup tests")
377378
self._test_basebackups(capsys, db, pghoard, tmpdir, BaseBackupMode.local_tar)
378379

379380
def test_basebackups_local_tar_exclusive_conflict(self, capsys, db, pghoard, tmpdir):
380-
if db.pgver >= "9.6":
381+
if LooseVersion(db.pgver) >= "9.6":
381382
pytest.skip("PostgreSQL < 9.6 required for exclusive backup tests")
382383
need_stop = False
383384
try:
@@ -409,7 +410,7 @@ def test_basebackups_local_tar_pgespresso(self, capsys, db, pghoard, tmpdir):
409410
cursor.execute("DROP EXTENSION pgespresso")
410411

411412
def test_basebackups_replica_local_tar_nonexclusive(self, capsys, recovery_db, pghoard, tmpdir):
412-
if recovery_db.pgver < "9.6":
413+
if LooseVersion(recovery_db.pgver) < "9.6":
413414
pytest.skip("PostgreSQL 9.6+ required for non-exclusive backups")
414415
self._test_basebackups(capsys, recovery_db, pghoard, tmpdir, BaseBackupMode.local_tar, replica=True)
415416

0 commit comments

Comments
 (0)