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

init tests failing if no swap is available. #57

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

init tests failing if no swap is available. #57

giampaolo opened this issue May 23, 2014 · 5 comments

Comments

@giampaolo
Copy link
Owner

From matrixhasu on July 04, 2009 08:52:05

Hello, What steps will reproduce the problem?  


What is the expected output?  


What do you see instead?  
My system don't have any swap:

$ free -m
             total       used       free     shared    buffers     cached
Mem:          3966       3795        170          0         28        969
-/+ buffers/cache:       2797       1168
Swap:            0          0          0

and so also psutil shows 0:

In [1]: import psutil as p

In [2]: p.avail_virtmem
Out[2]: <function avail_virtmem at 0x1e38f50>

In [3]: p.avail_virtmem()
Out[3]: 0

In [4]: p.total_virtmem()
Out[4]: 0

But then tests are failing because the assert it to be > 0:

======================================================================
FAIL: test_avail_virtmem (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 102, in test_avail_virtmem
    self.assertTrue(x > 0)
AssertionError

======================================================================
FAIL: test_total_virtmem (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 92, in test_total_virtmem
    self.assertTrue(x > 0)
AssertionError

----------------------------------------------------------------------

My suggestion is to change it to >= 0 . What version of psutil are you using? 
On what operating system? psutil = 0.1.2 (you may also want to add a __version__ to the module)
os = Debian Sid

Thanks for considering,
Sandro

Original issue: http://code.google.com/p/psutil/issues/detail?id=57

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

From billiej...@gmail.com on July 06, 2009 08:24:10

Fixed as r413 (also added the __version__ module level variable).
Thanks for signaling.

Status: Fixed
Labels: Milestone-0.1.3 Component-Tests

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on July 06, 2009 08:26:24

Status: Fixed

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on September 03, 2009 12:48:09

Status: FixedInSVN

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on September 17, 2009 01:57:42

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:49:48

Updated csets after the SVN -> Mercurial migration: r413 == revision aada682d9e36

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