|
9 | 9 | import tarfile |
10 | 10 | import time |
11 | 11 | from copy import deepcopy |
| 12 | +from distutils.version import LooseVersion |
12 | 13 | from queue import Queue |
13 | 14 | from subprocess import check_call |
14 | 15 |
|
@@ -367,17 +368,17 @@ def test_basebackups_local_tar_with_delta_stats(self, capsys, db, pghoard, tmpdi |
367 | 368 | self._test_basebackups(capsys, db, pghoard, tmpdir, BaseBackupMode.local_tar_delta_stats) |
368 | 369 |
|
369 | 370 | def test_basebackups_local_tar_nonexclusive(self, capsys, db, pghoard, tmpdir): |
370 | | - if db.pgver < "9.6": |
| 371 | + if LooseVersion(db.pgver) < "9.6": |
371 | 372 | pytest.skip("PostgreSQL 9.6+ required for non-exclusive backups") |
372 | 373 | self._test_basebackups(capsys, db, pghoard, tmpdir, BaseBackupMode.local_tar) |
373 | 374 |
|
374 | 375 | def test_basebackups_local_tar_legacy(self, capsys, db, pghoard, tmpdir): |
375 | | - if db.pgver >= "9.6": |
| 376 | + if LooseVersion(db.pgver) >= "9.6": |
376 | 377 | pytest.skip("PostgreSQL < 9.6 required for exclusive backup tests") |
377 | 378 | self._test_basebackups(capsys, db, pghoard, tmpdir, BaseBackupMode.local_tar) |
378 | 379 |
|
379 | 380 | 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": |
381 | 382 | pytest.skip("PostgreSQL < 9.6 required for exclusive backup tests") |
382 | 383 | need_stop = False |
383 | 384 | try: |
@@ -409,7 +410,7 @@ def test_basebackups_local_tar_pgespresso(self, capsys, db, pghoard, tmpdir): |
409 | 410 | cursor.execute("DROP EXTENSION pgespresso") |
410 | 411 |
|
411 | 412 | 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": |
413 | 414 | pytest.skip("PostgreSQL 9.6+ required for non-exclusive backups") |
414 | 415 | self._test_basebackups(capsys, recovery_db, pghoard, tmpdir, BaseBackupMode.local_tar, replica=True) |
415 | 416 |
|
|
0 commit comments