Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

tests: give disable.sh an empty stdin, so the suite doesn't hang in a terminal

Caner9a3acf3a7895
diff --git a/tests/test_debloat_paths.py b/tests/test_debloat_paths.py
index c07859272..ed1ee81d0 100644
--- a/tests/test_debloat_paths.py
+++ b/tests/test_debloat_paths.py
@@ -66,9 +66,10 @@ class DebloatPathsTest(unittest.TestCase):
# tests exercise. HOME is isolated so a record from a real run cannot answer instead.
env = {k: v for k, v in os.environ.items() if k != "TV_HOST"}
env.update(CAPTURE=str(capture), HOME=str(home))
+ # The fake tv.py reads its stdin, so an inherited terminal would leave it waiting.
result = subprocess.run(
["bash", str(script_path), argument], cwd=cwd, env=env,
- capture_output=True, text=True,
+ capture_output=True, text=True, stdin=subprocess.DEVNULL,
)
return result, capture
diff --git a/tests/test_setupwraith_guard.py b/tests/test_setupwraith_guard.py
index 74dc81cbf..576950f8a 100644
--- a/tests/test_setupwraith_guard.py
+++ b/tests/test_setupwraith_guard.py
@@ -39,8 +39,9 @@ class SetupwraithGuardTest(unittest.TestCase):
(repo / "debloat.txt").write_text(LIST)
capture = Path(tmp) / "commands.txt"
env = dict(os.environ, CAPTURE=str(capture), **(extra_env or {}))
+ # The fake tv.py reads its stdin, so an inherited terminal would leave it waiting.
result = subprocess.run(["bash", str(tools / "disable.sh"), "debloat.txt"], cwd=repo,
- env=env, capture_output=True, text=True)
+ env=env, capture_output=True, text=True, stdin=subprocess.DEVNULL)
self.assertEqual(result.returncode, 0, result.stderr)
return capture.read_text().splitlines(), result.stderr