@@ -810,8 +810,7 @@ def run_pb(self, command, asynchronous=False, gdb=False, old_binary=False, retur
810
810
if self .verbose :
811
811
print (self .cmd )
812
812
if gdb :
813
- #TODO REVIEW XXX no self parameter
814
- return GDBobj ([binary_path ] + command , self .verbose )
813
+ return GDBobj ([binary_path ] + command , self )
815
814
if asynchronous :
816
815
return subprocess .Popen (
817
816
[binary_path ] + command ,
@@ -1862,8 +1861,7 @@ def compare_pgdata(self, original_pgdata, restored_pgdata, exclusion_dict = dict
1862
1861
self .assertFalse (fail , error_message )
1863
1862
1864
1863
def gdb_attach (self , pid ):
1865
- #TODO REVIEW XXX no self parameter
1866
- return GDBobj ([str (pid )], self .verbose , attach = True )
1864
+ return GDBobj ([str (pid )], self , attach = True )
1867
1865
1868
1866
def _check_gdb_flag_or_skip_test (self ):
1869
1867
if not self .gdb :
@@ -1872,24 +1870,28 @@ def _check_gdb_flag_or_skip_test(self):
1872
1870
"optimizations for run this test"
1873
1871
)
1874
1872
1873
+
1875
1874
class GdbException (Exception ):
1876
- def __init__ (self , message = False ):
1875
+ def __init__ (self , message = " False" ):
1877
1876
self .message = message
1878
1877
1879
1878
def __str__ (self ):
1880
1879
return '\n ERROR: {0}\n ' .format (repr (self .message ))
1881
1880
1882
1881
1883
- class GDBobj (ProbackupTest ):
1884
- def __init__ (self , cmd , verbose , attach = False ):
1885
- self .verbose = verbose
1882
+ #TODO REVIEW XXX no inheritance needed
1883
+ # class GDBobj(ProbackupTest):
1884
+ class GDBobj :
1885
+ # TODO REVIEW XXX Type specification env:ProbackupTest is only for python3, is it ok?
1886
+ def __init__ (self , cmd , env : ProbackupTest , attach = False ):
1887
+ self .verbose = env .verbose
1886
1888
self .output = ''
1887
1889
1888
1890
# Check gdb flag is set up
1889
- # if not self .gdb:
1890
- # raise GdbException("No `PGPROBACKUP_GDB=on` is set, "
1891
- # "test should call ProbackupTest::check_gdb_flag_or_skip_test() on its start "
1892
- # "and be skipped")
1891
+ if not env .gdb :
1892
+ raise GdbException ("No `PGPROBACKUP_GDB=on` is set, "
1893
+ "test should call ProbackupTest::check_gdb_flag_or_skip_test() on its start "
1894
+ "and be skipped" )
1893
1895
# Check gdb presense
1894
1896
try :
1895
1897
gdb_version , _ = subprocess .Popen (
0 commit comments