Skip to content

Commit b417418

Browse files
committed
make psutil a dependency
1 parent 1dc3c92 commit b417418

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from distutils.core import setup
77

88
# Basic dependencies
9-
install_requires = ["pg8000", "port-for>=0.4", "six>=1.9.0"]
9+
install_requires = ["pg8000", "port-for>=0.4", "six>=1.9.0", "psutil"]
1010

1111
# Add compatibility enum class
1212
if sys.version_info < (3, 4):

Diff for: testgres/node.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io
44
import os
5+
import psutil
56
import subprocess
67
import time
78

@@ -183,11 +184,6 @@ def child_processes(self):
183184
Each process is represented by ProcessProxy object.
184185
"""
185186

186-
try:
187-
import psutil
188-
except ImportError:
189-
raise TestgresException("psutil module is not installed")
190-
191187
# get a list of postmaster's children
192188
children = psutil.Process(self.pid).children()
193189

Diff for: tests/test_simple.py

-9
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ def good_properties(f):
6060
return True
6161

6262

63-
def module_exists(module):
64-
try:
65-
__import__(module)
66-
return True
67-
except ImportError:
68-
return False
69-
70-
7163
@contextmanager
7264
def removing(f):
7365
try:
@@ -711,7 +703,6 @@ def test_version_management(self):
711703
self.assertTrue(b > c)
712704
self.assertTrue(a > c)
713705

714-
@unittest.skipUnless(module_exists('psutil'), 'might be missing')
715706
def test_child_pids(self):
716707
master_processes = [
717708
ProcessType.AutovacuumLauncher,

0 commit comments

Comments
 (0)