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

Commit fab25a1

Browse files
committed
Merge branch 'master' into 'master'
Temporary workaround for postgrespro/pg_probackup#447 See merge request automation/pg-tests!1366
2 parents 945146f + 8797f4d commit fab25a1

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

patches/pg_probackup_py2_compat.patch

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/tests/restore.py b/tests/restore.py
2+
index 47419e5a..b3d4aef7 100644
3+
--- a/tests/restore.py
4+
+++ b/tests/restore.py
5+
@@ -4,7 +4,11 @@ from .helpers.ptrack_helpers import ProbackupTest, ProbackupException
6+
import subprocess
7+
import sys
8+
from time import sleep
9+
-from datetime import datetime, timedelta, timezone
10+
+from datetime import datetime, timedelta
11+
+try:
12+
+ from datetime import timezone
13+
+except ImportError: # py2compat
14+
+ from pytz import timezone
15+
import hashlib
16+
import shutil
17+
import json

tests_install/requirements2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pytest-json==0.4.0
99
enum34==1.1.6
1010
testgres==1.8.2
1111
pathlib
12+
pytz

tests_install/test_pgprobackup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ def test_pgprobackup_internal(self, request):
194194
os.path.join(dir, 'tests', 'helpers',
195195
'ptrack_helpers.py'),
196196
shell=True)
197+
# https://github.com/postgrespro/pg_probackup/pull/447
198+
if sys.version_info < (3, 0):
199+
self.pginst.os.install_package('patch')
200+
subprocess.check_call(
201+
"patch -p1 -i ../patches/pg_probackup_py2_compat.patch",
202+
shell=True, cwd=dir
203+
)
197204
self.fix_permissions(dir)
198205
# PGPRO-4108 wait ptrack2.0 in 10
199206
cmd = "%s sh -c 'PG_CONFIG=\"%s/pg_config\"" \

0 commit comments

Comments
 (0)