summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-09-27 00:40:11 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2020-09-27 00:40:11 +0200
commite540554baba8bf9e2c8499cfb9dad4f0d4e0fffb (patch)
tree775b7313679dcbbde13134ef690d7e460cb52110
parentfbcbd8edd030f83767a9b83ee25cd7a142d6171e (diff)
downloadpsutil-e540554baba8bf9e2c8499cfb9dad4f0d4e0fffb.tar.gz
remove faulty test
-rwxr-xr-xpsutil/tests/test_linux.py11
-rwxr-xr-xpsutil/tests/test_process.py4
2 files changed, 1 insertions, 14 deletions
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py
index 65e55449..75b7639f 100755
--- a/psutil/tests/test_linux.py
+++ b/psutil/tests/test_linux.py
@@ -1440,17 +1440,6 @@ class TestSensorsBattery(PsutilTestCase):
psutil_value = psutil.sensors_battery().percent
self.assertAlmostEqual(acpi_value, psutil_value, delta=1)
- @unittest.skipIf(not which("acpi"), "acpi utility not available")
- def test_power_plugged(self):
- out = sh("acpi -b")
- if 'unknown' in out.lower():
- return unittest.skip("acpi output not reliable")
- if 'discharging at zero rate' in out:
- plugged = True
- else:
- plugged = "Charging" in out.split('\n')[0]
- self.assertEqual(psutil.sensors_battery().power_plugged, plugged)
-
def test_emulate_power_plugged(self):
# Pretend the AC power cable is connected.
def open_mock(name, *args, **kwargs):
diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py
index 8b5e5c56..b2328ba2 100755
--- a/psutil/tests/test_process.py
+++ b/psutil/tests/test_process.py
@@ -298,11 +298,9 @@ class TestProcess(PsutilTestCase):
@unittest.skipIf(TRAVIS or CIRRUS, 'not reliable on TRAVIS/CIRRUS')
def test_terminal(self):
terminal = psutil.Process().terminal()
- if sys.stdin.isatty():
+ if terminal is not None:
tty = os.path.realpath(sh('tty'))
self.assertEqual(terminal, tty)
- else:
- self.assertIsNone(terminal)
@unittest.skipIf(not HAS_PROC_IO_COUNTERS, 'not supported')
@skip_on_not_implemented(only_if=LINUX)