From 1eb230208573159948674aa4f4287f74f4c9ed4e Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 13 Feb 2017 18:21:01 +0100 Subject: fix test --- psutil/_pslinux.py | 2 +- 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 -- cgit v1.2.1