summaryrefslogtreecommitdiff
path: root/psutil/tests/test_system.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-04-30 09:21:03 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-04-30 09:21:03 +0200
commit1223096701f8ec2a2518bfd813a96be1a51b483b (patch)
treea7b6da13d1ef696dba5c49be39629ddc90f2480c /psutil/tests/test_system.py
parent27ab5a2329923a36b12bae681f1c64ef8e5091f1 (diff)
downloadpsutil-1223096701f8ec2a2518bfd813a96be1a51b483b.tar.gz
use HAS_ support constants in tests
Diffstat (limited to 'psutil/tests/test_system.py')
-rwxr-xr-xpsutil/tests/test_system.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
index 88bdd093..4f1781b8 100755
--- a/psutil/tests/test_system.py
+++ b/psutil/tests/test_system.py
@@ -35,12 +35,12 @@ from psutil.tests import check_net_address
from psutil.tests import DEVNULL
from psutil.tests import enum
from psutil.tests import get_test_subprocess
+from psutil.tests import HAS_BATTERY
from psutil.tests import HAS_CPU_FREQ
from psutil.tests import HAS_SENSORS_BATTERY
from psutil.tests import HAS_SENSORS_FANS
from psutil.tests import HAS_SENSORS_TEMPERATURES
from psutil.tests import mock
-from psutil.tests import NO_BATTERY
from psutil.tests import reap_children
from psutil.tests import retry_before_failing
from psutil.tests import run_test_module_by_name
@@ -805,11 +805,10 @@ class TestSystemAPIs(unittest.TestCase):
self.assertEqual(temps.high, 140.0)
self.assertEqual(temps.critical, 158.0)
- @unittest.skipIf(not HAS_SENSORS_BATTERY or NO_BATTERY, "not supported")
+ @unittest.skipIf(not HAS_SENSORS_BATTERY, "not supported")
+ @unittest.skipIf(not HAS_BATTERY, "no battery")
def test_sensors_battery(self):
ret = psutil.sensors_battery()
- if ret is None:
- return # no battery
self.assertGreaterEqual(ret.percent, 0)
self.assertLessEqual(ret.percent, 100)
if ret.secsleft not in (psutil.POWER_TIME_UNKNOWN,