summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-01-21 10:11:21 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2016-01-21 10:11:21 +0100
commitc17749b70584148284823591f7fa4f8bd4a7d05a (patch)
treeba5bdee498661a9244ae4696d6897b33a1d7521c
parent6e69cf7aa3fef810919d4c2be0705927b054aa39 (diff)
downloadpsutil-c17749b70584148284823591f7fa4f8bd4a7d05a.tar.gz
improve test
-rw-r--r--HISTORY.rst1
-rw-r--r--setup.py1
-rw-r--r--test/_linux.py4
-rw-r--r--test/test_psutil.py6
4 files changed, 8 insertions, 4 deletions
diff --git a/HISTORY.rst b/HISTORY.rst
index d715fb08..f39478d6 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -11,6 +11,7 @@ Bug tracker at https://github.com/giampaolo/psutil/issues
**Bug fixes**
+- #724: [FreeBSD] psutil.virtual_memory().total is incorrect.
- #730: [FreeBSD] psutil.virtual_memory() crashes.
diff --git a/setup.py b/setup.py
index fb85a8fb..4d4d8650 100644
--- a/setup.py
+++ b/setup.py
@@ -261,6 +261,7 @@ def main():
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python',
diff --git a/test/_linux.py b/test/_linux.py
index 0ca9049c..ff533e9b 100644
--- a/test/_linux.py
+++ b/test/_linux.py
@@ -490,7 +490,8 @@ class LinuxSpecificTestCase(unittest.TestCase):
psutil.PROCFS_PATH = "/proc"
os.rmdir(tdir)
- def test_no_procfs_for_import(self):
+ @mock.patch('psutil.traceback.print_exc')
+ def test_no_procfs_for_import(self, tb):
my_procfs = tempfile.mkdtemp()
with open(os.path.join(my_procfs, 'stat'), 'w') as f:
@@ -509,6 +510,7 @@ class LinuxSpecificTestCase(unittest.TestCase):
patch_point = 'builtins.open' if PY3 else '__builtin__.open'
with mock.patch(patch_point, side_effect=open_mock):
importlib.reload(psutil)
+ assert tb.called
self.assertRaises(IOError, psutil.cpu_times)
self.assertRaises(IOError, psutil.cpu_times, percpu=True)
diff --git a/test/test_psutil.py b/test/test_psutil.py
index 3fe71317..c2c70fec 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -3061,6 +3061,9 @@ class TestMisc(unittest.TestCase):
psutil.Process()
assert meth.called
+ def test_psutil_is_reloadable(self):
+ importlib.reload(psutil)
+
# ===================================================================
# --- Example script tests
@@ -3227,9 +3230,6 @@ class TestUnicode(unittest.TestCase):
self.assertIsInstance(path, str)
self.assertEqual(os.path.normcase(path), os.path.normcase(self.uexe))
- def test_psutil_is_reloadable(self):
- importlib.reload(psutil)
-
def main():
tests = []