diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 1aba0418fa..4c683c8d10 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -971,20 +971,22 @@ def assertPidGone(self, pid): self.assertNotIn(pid, [x.pid for x in psutil.process_iter()]) def assertProcessGone(self, proc): - self.assertPidGone(proc.pid) - ns = process_namespace(proc) - for fun, name in ns.iter(ns.all, clear_cache=True): - with self.subTest(proc=proc, name=name): - try: - ret = fun() - except psutil.ZombieProcess: - raise - except psutil.NoSuchProcess as exc: - self._check_proc_exc(proc, exc) - else: - msg = "Process.%s() didn't raise NSP and returned %r" % ( - name, ret) - raise AssertionError(msg) + with self.assertRaises(psutil.NoSuchProcess): + proc.kill() + # self.assertPidGone(proc.pid) + # ns = process_namespace(proc) + # for fun, name in ns.iter(ns.all, clear_cache=True): + # with self.subTest(proc=proc, name=name): + # try: + # ret = fun() + # except psutil.ZombieProcess: + # raise + # except psutil.NoSuchProcess as exc: + # self._check_proc_exc(proc, exc) + # else: + # msg = "Process.%s() didn't raise NSP and returned %r" % ( + # name, ret) + # raise AssertionError(msg) proc.wait(timeout=0) # assert not raise TimeoutExpired def assertProcessZombie(self, proc):