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

Commite27f01b

Browse files
committed
minor fixes to ProcessProxy
1 parentc86c0bf commite27f01b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

‎testgres/node.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ def __init__(self, process):
8080
def__getattr__(self,name):
8181
returngetattr(self.process,name)
8282

83-
def__str__(self):
84-
pid=self.process.pid
85-
cmdline=' '.join(self.process.cmdline()).strip()
86-
return'{} [{}]'.format(cmdline,pid)
83+
def__repr__(self):
84+
return'{} : {}'.format(str(self.ptype),repr(self.process))
8785

8886

8987
classPostgresNode(object):
@@ -219,7 +217,8 @@ def source_walsender(self):
219217
ifchild.pid==int(row[0]):
220218
returnchild
221219

222-
raiseQueryException("Master doesn't send WAL to {}",self.name)
220+
msg="Master doesn't send WAL to {}".format(self.name)
221+
raiseTestgresException(msg)
223222

224223
@property
225224
defmaster(self):
@@ -968,7 +967,7 @@ def catchup(self, dbname=None, username=None):
968967
"""
969968

970969
ifnotself.master:
971-
raiseCatchUpException("Node doesn't have a master")
970+
raiseTestgresException("Node doesn't have a master")
972971

973972
ifpg_version_ge('10'):
974973
poll_lsn="select pg_current_wal_lsn()::text"

‎tests/test_simple.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
ExecUtilException, \
2121
BackupException, \
2222
QueryException, \
23-
CatchUpException, \
2423
TimeoutException, \
2524
TestgresException
2625

@@ -397,7 +396,7 @@ def test_incorrect_catchup(self):
397396
node.init(allow_streaming=True).start()
398397

399398
# node has no master, can't catch up
400-
withself.assertRaises(CatchUpException):
399+
withself.assertRaises(TestgresException):
401400
node.catchup()
402401

403402
deftest_dump(self):
@@ -759,7 +758,7 @@ def test_child_pids(self):
759758
replica.stop()
760759

761760
# there should be no walsender after we've stopped replica
762-
withself.assertRaises(QueryException):
761+
withself.assertRaises(TestgresException):
763762
replica.source_walsender
764763

765764

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp