summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2015-11-08 15:11:34 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2015-11-08 15:11:34 +0100
commitf60f3723ab8a2ba1798f38c4d8dbd456445d2fa8 (patch)
treea15de2be6311aabd59d91d6309456ae2a099b6c2
parent03348fa3213b480bc7b6e3e92a2a6f81afd492ff (diff)
downloadpsutil-f60f3723ab8a2ba1798f38c4d8dbd456445d2fa8.tar.gz
add new test for Process.threads()
-rw-r--r--test/test_psutil.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_psutil.py b/test/test_psutil.py
index d8fa97e2..2f000bef 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -1627,6 +1627,13 @@ class TestProcess(unittest.TestCase):
if thread._running:
thread.stop()
+ def test_threads_2(self):
+ p = psutil.Process()
+ self.assertAlmostEqual(p.cpu_times().user,
+ p.threads()[0].user_time, delta=0.1)
+ self.assertAlmostEqual(p.cpu_times().system,
+ p.threads()[0].system_time, delta=0.1)
+
def test_memory_info(self):
p = psutil.Process()