summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-02-26 16:00:13 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-26 16:00:13 -0800
commit4faef5bc430080e66a8254e0afb8951dc1931ebf (patch)
tree4dcf5570369a0dccf1807314d4f605bd1a6d8ee2
parented9653aa4835289f3bf64b7956dfcc739f2a216b (diff)
downloadpsutil-4faef5bc430080e66a8254e0afb8951dc1931ebf.tar.gz
add win tests related to send_signal(CTRL_C_EVENT) #1227
-rwxr-xr-xpsutil/tests/test_process.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py
index 7380b60c..16c0ba4a 100755
--- a/psutil/tests/test_process.py
+++ b/psutil/tests/test_process.py
@@ -1256,12 +1256,16 @@ class TestProcess(unittest.TestCase):
p.wait()
if WINDOWS:
call_until(psutil.pids, "%s not in ret" % p.pid)
- self.assertFalse(p.is_running())
- # self.assertFalse(p.pid in psutil.pids(), msg="retcode = %s" %
- # retcode)
+ assert not p.is_running()
+
+ if WINDOWS:
+ with self.assertRaises(psutil.NoSuchProcess):
+ p.send_signal(signal.CTRL_C_EVENT)
+ with self.assertRaises(psutil.NoSuchProcess):
+ p.send_signal(signal.CTRL_BREAK_EVENT)
excluded_names = ['pid', 'is_running', 'wait', 'create_time',
- 'oneshot', 'memory_info_ex']
+ 'oneshot']
if LINUX and not HAS_RLIMIT:
excluded_names.append('rlimit')
for name in dir(p):