nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

test_name failures on OS X #121

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
======================================================================
FAIL: test_name (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 409, in test_name
    self.assertEqual(psutil.Process(sproc.pid).name, os.path.basename(PYTHON))
AssertionError: 'Python' != 'python'

======================================================================
FAIL: test_process_name (_posix.PosixSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jloden/src/psutil/test/_posix.py", line 88, in test_process_name
    self.assertEqual(name_ps, name_psutil)
AssertionError: 'python' != 'Python'

This is occurring because the kernel/BSD process list on OS X reports the 
process name as "Python" but sys.executable is /usr/bin/python. Using ps on the 
command line  just reports cmdline[0], so usually just "python". We have 3 
different results, none of them "wrong" - just looking at different 
information. Opening this so we can record discussion on what to do with this. 

Since we're reporting the same thing as the kernel I would favor changing the 
test cases but then we need some kind of alternative test case that's reliable 
as well. 

Original issue reported on code.google.com by jlo...@gmail.com on 23 Oct 2010 at 6:49

GoogleCodeExporter commented 8 years ago
For now the test just checks explicitly for "Python" as the name on OS X only

Original comment by jlo...@gmail.com on 27 Oct 2010 at 10:43

GoogleCodeExporter commented 8 years ago

Original comment by jlo...@gmail.com on 27 Oct 2010 at 10:50

GoogleCodeExporter commented 8 years ago

Original comment by jlo...@gmail.com on 27 Oct 2010 at 10:51

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 12 Nov 2010 at 8:01