From a17a6d6c0de3a9804452b13881eb544fc726b2d6 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Tue, 24 Jan 2017 17:51:37 +0100 Subject: #371 add sensors.py example script --- psutil/tests/test_misc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py index 0b696f8c..e534e006 100755 --- a/psutil/tests/test_misc.py +++ b/psutil/tests/test_misc.py @@ -388,7 +388,7 @@ class TestScripts(unittest.TestCase): src = f.read() ast.parse(src) - def test_check_presence(self): + def test_coverage(self): # make sure all example scripts have a test method defined meths = dir(self) for name in os.listdir(SCRIPTS_DIR): @@ -469,6 +469,11 @@ class TestScripts(unittest.TestCase): def test_cpu_distribution(self): self.assert_syntax('cpu_distribution.py') + @unittest.skipUnless(hasattr(psutil, "sensors_temperatures"), + "platform not supported") + def test_sensors(self): + self.assert_stdout('sensors.py') + # =================================================================== # --- Unit tests for test utilities. -- cgit v1.2.1