Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Temporary workaround for postgrespro/pg_probackup#447
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBille committed Oct 26, 2021
1 parent 945146f commit 8797f4d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions patches/pg_probackup_py2_compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/tests/restore.py b/tests/restore.py
index 47419e5a..b3d4aef7 100644
--- a/tests/restore.py
+++ b/tests/restore.py
@@ -4,7 +4,11 @@ from .helpers.ptrack_helpers import ProbackupTest, ProbackupException
import subprocess
import sys
from time import sleep
-from datetime import datetime, timedelta, timezone
+from datetime import datetime, timedelta
+try:
+ from datetime import timezone
+except ImportError: # py2compat
+ from pytz import timezone
import hashlib
import shutil
import json
1 change: 1 addition & 0 deletions tests_install/requirements2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pytest-json==0.4.0
enum34==1.1.6
testgres==1.8.2
pathlib
pytz
7 changes: 7 additions & 0 deletions tests_install/test_pgprobackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ def test_pgprobackup_internal(self, request):
os.path.join(dir, 'tests', 'helpers',
'ptrack_helpers.py'),
shell=True)
# https://github.com/postgrespro/pg_probackup/pull/447
if sys.version_info < (3, 0):
self.pginst.os.install_package('patch')
subprocess.check_call(
"patch -p1 -i ../patches/pg_probackup_py2_compat.patch",
shell=True, cwd=dir
)
self.fix_permissions(dir)
# PGPRO-4108 wait ptrack2.0 in 10
cmd = "%s sh -c 'PG_CONFIG=\"%s/pg_config\"" \
Expand Down

0 comments on commit 8797f4d

Please sign in to comment.