diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-13 18:21:01 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-13 18:21:01 +0100 |
commit | 1eb230208573159948674aa4f4287f74f4c9ed4e (patch) | |
tree | 63c8eb84de31e5a80bf40a898bd836b0c896be8a | |
parent | bf533cc13558479880c5ca32f8cb93aae998f4ad (diff) | |
download | psutil-nicolargo-fansensor.tar.gz |
fix testnicolargo-fansensor
-rw-r--r-- | psutil/_pslinux.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_memory_leaks.py | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index ce20e8a0..f6a6932d 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1144,7 +1144,7 @@ def sensors_fans(): ret[unit_name].append((label, current)) - return ret + return dict(ret) def sensors_battery(): diff --git a/psutil/tests/test_memory_leaks.py b/psutil/tests/test_memory_leaks.py index 5adb2b5e..a55008e5 100755 --- a/psutil/tests/test_memory_leaks.py +++ b/psutil/tests/test_memory_leaks.py @@ -562,7 +562,19 @@ class TestModuleFunctionsLeaks(TestMemLeak): "platform not supported") @skip_if_linux() def test_sensors_battery(self): - self.execute(psutil.sensors_battery()) + self.execute(psutil.sensors_battery) + + @skip_if_linux() + @unittest.skipUnless(hasattr(psutil, "sensors_temperatures"), + "platform not supported") + def test_sensors_temperatures(self): + self.execute(psutil.sensors_temperatures) + + @unittest.skipUnless(hasattr(psutil, "sensors_fans"), + "platform not supported") + @skip_if_linux() + def test_sensors_fans(self): + self.execute(psutil.sensors_fans) # --- others @@ -575,12 +587,6 @@ class TestModuleFunctionsLeaks(TestMemLeak): def test_users(self): self.execute(psutil.users) - @unittest.skipUnless(hasattr(psutil, "sensors_temperatures"), - "platform not supported") - @skip_if_linux() - def test_sensors_temperatures(self): - self.execute(psutil.users) - if WINDOWS: # --- win services |