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

Commit390ed7c

Browse files
committed
Raise exception for functions that require psutil when psutil is not installed
1 parentf6d1e5b commit390ed7c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

‎testgres/node.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,7 @@ def get_child_processes(self):
445445
''' Returns child processes for this node '''
446446

447447
ifpsutilisNone:
448-
warnings.warn("psutil module is not installed")
449-
returnNone
448+
raiseTestgresException("psutil module is not installed")
450449

451450
try:
452451
postmaster=psutil.Process(self.pid)

‎tests/test_simple.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
BackupException, \
2222
QueryException, \
2323
CatchUpException, \
24-
TimeoutException
24+
TimeoutException, \
25+
TestgresException
2526

2627
fromtestgresimport \
2728
TestgresConfig, \
@@ -739,8 +740,10 @@ def test_pids(self):
739740
withbackup.spawn_replica('repl',True)asrepl:
740741
repl.start()
741742
ifpsutilisNone:
742-
self.assertIsNone(master.auxiliary_pids)
743-
self.assertIsNone(repl.auxiliary_pids)
743+
withself.assertRaises(TestgresException):
744+
master.auxiliary_pids
745+
withself.assertRaises(TestgresException):
746+
self.assertIsNone(repl.auxiliary_pids)
744747
else:
745748
master_pids=master.auxiliary_pids
746749
forptypeinmaster_processes:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp