Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdab3957

Browse files
committed
copy-paste some test fixes
authors: Victoria Shepard and Sergey Fukanchik
1 parent0cf3d05 commitdab3957

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

‎tests/helpers/ptrack_helpers.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# you need os for unittest to work
22
importos
3-
importgc
43
importthreading
54
importunittest
6-
fromsysimportexit,argv,version_info
5+
fromsysimportexit,argv
76
importsignal
87
importsubprocess
98
importshutil
10-
importsix
119
importtestgres
1210
importhashlib
13-
importre
1411
importgetpass
15-
importselect
1612
fromtimeimportsleep
1713
importre
1814
importjson
@@ -143,6 +139,7 @@ def __init__(self, message, cmd):
143139
def__str__(self):
144140
return'\n ERROR: {0}\n CMD: {1}'.format(repr(self.message),self.cmd)
145141

142+
146143
classPostgresNodeExtended(testgres.PostgresNode):
147144

148145
def__init__(self,base_dir=None,*args,**kwargs):
@@ -227,6 +224,7 @@ def table_checksum(self, table, dbname="postgres"):
227224
con.close()
228225
returnsum.hexdigest()
229226

227+
230228
classProbackupTest(object):
231229
# Class attributes
232230
enterprise=is_enterprise()
@@ -238,8 +236,13 @@ def __init__(self, *args, **kwargs):
238236
self.nodes_to_cleanup= []
239237

240238
ifisinstance(self,unittest.TestCase):
241-
self.module_name=self.id().split('.')[1]
242-
self.fname=self.id().split('.')[3]
239+
try:
240+
self.module_name=self.id().split('.')[-2]
241+
self.fname=self.id().split('.')[-1]
242+
exceptIndexError:
243+
print("Couldn't get module name and function name from self.id(): `{}`".format(self.id()))
244+
self.module_name=self.module_nameifself.module_nameelsestr(self).split('(')[1].split('.')[1]
245+
self.fname=str(self).split('(')[0]
243246

244247
if'-v'inargvor'--verbose'inargv:
245248
self.verbose=True

‎tests/ptrack_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class PtrackTest(ProbackupTest, unittest.TestCase):
1414
defsetUp(self):
1515
ifself.pg_config_version<self.version_to_num('11.0'):
1616
self.skipTest('You need PostgreSQL >= 11 for this test')
17-
self.fname=self.id().split('.')[3]
1817

1918
# @unittest.skip("skip")
2019
deftest_drop_rel_during_backup_ptrack(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp