Skip to content

Commit

Permalink
refact
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Aug 1, 2023
1 parent e63e667 commit a20cec1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions psutil/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,17 +1328,15 @@ def succeed_or_zombie_p_exc(fun):

parent, zombie = self.spawn_zombie()
self.assertProcessZombie(zombie)

zproc = psutil.Process(zombie.pid)
ns = process_namespace(zproc)
ns = process_namespace(zombie)
for fun, name in ns.iter(ns.all):
succeed_or_zombie_p_exc(fun)

assert psutil.pid_exists(zproc.pid)
self.assertIn(zproc.pid, psutil.pids())
self.assertIn(zproc.pid, [x.pid for x in psutil.process_iter()])
assert psutil.pid_exists(zombie.pid)
self.assertIn(zombie.pid, psutil.pids())
self.assertIn(zombie.pid, [x.pid for x in psutil.process_iter()])
psutil._pmap = {}
self.assertIn(zproc.pid, [x.pid for x in psutil.process_iter()])
self.assertIn(zombie.pid, [x.pid for x in psutil.process_iter()])

@unittest.skipIf(not POSIX, 'POSIX only')
def test_zombie_process_is_running_w_exc(self):
Expand Down

0 comments on commit a20cec1

Please sign in to comment.