--- psutil/tests/test_linux.py | 4 ++++ 1 file changed, 4 insertions(+) --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -1614,6 +1614,8 @@ class TestSensorsBattery(PsutilTestCase) self.assertIsNone(psutil.sensors_battery().power_plugged) assert m.called + @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'), + 'Missing /sys/class/power_supply/BAT0/energy_full file.') def test_emulate_energy_full_0(self): # Emulate a case where energy_full files returns 0. with mock_open_content( @@ -1621,6 +1623,8 @@ class TestSensorsBattery(PsutilTestCase) self.assertEqual(psutil.sensors_battery().percent, 0) assert m.called + @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'), + 'Missing /sys/class/power_supply/BAT0/energy_full file.') def test_emulate_energy_full_not_avail(self): # Emulate a case where energy_full file does not exist. # Expected fallback on /capacity.