Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test asserts due to leftover test subprocesses (#1161)
* Reap test subprocess. The leftover child process was triggering an assert in a later test: ====================================================================== FAIL: psutil.tests.test_connections.TestConnectedSocketPairs.test_combos ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ade/projects/psutil/psutil/tests/__init__.py", line 792, in wrapper return fun(*args, **kwargs) File "/home/ade/projects/psutil/psutil/tests/test_connections.py", line 330, in test_combos self.assertEqual(len(cons), 1) AssertionError: 0 != 1 * Inherit from Base so that reap_children() cleans up the test processes. Fixes memory leak test asserts. psutil/tests/test_memory_leaks.py:334: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ psutil/tests/test_memory_leaks.py:125: in execute self.assertEqual(thisproc.children(), []) E AssertionError: Lists differ: [<psutil.Process(pid=908, name... != [] E E First list contains 10 additional elements. E First extra element 0: E <psutil.Process(pid=908, name='python2.7') at 34513317008> E E + [] E - [<psutil.Process(pid=908, name='python2.7') at 34513317008>, E - <psutil.Process(pid=909, name='python2.7') at 34459063760>, E - <psutil.Process(pid=910, name='python2.7') at 34459064464>, E - <psutil.Process(pid=911, name='python2.7') at 34513749456>, E - <psutil.Process(pid=912, name='python2.7') at 34513749520>, E - <psutil.Process(pid=913, name='python2.7') at 34513751184>, E - <psutil.Process(pid=914, name='python2.7') at 34513751120>, E - <psutil.Process(pid=915, name='python2.7') at 34513751312>, E - <psutil.Process(pid=916, name='python2.7') at 34513751376>, E - <psutil.Process(pid=917, name='python2.7') at 34513748176>]
- Loading branch information