Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_name failures on OS X #121

Closed
giampaolo opened this issue May 23, 2014 · 4 comments
Closed

test_name failures on OS X #121

giampaolo opened this issue May 23, 2014 · 4 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on October 23, 2010 20:49:03

======================================================================
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: http://code.google.com/p/psutil/issues/detail?id=121

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From [email protected] on October 27, 2010 15:43:10

For now the test just checks explicitly for "Python" as the name on OS X only

@giampaolo
Copy link
Owner Author

From [email protected] on October 27, 2010 15:50:57

Status: WaitingForReview

@giampaolo
Copy link
Owner Author

From [email protected] on October 27, 2010 15:51:35

Labels: -Progress-0in4 Progress-4in4

@giampaolo
Copy link
Owner Author

From g.rodola on November 12, 2010 12:01:23

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant