Run each table-driven test case in its own subTest and split the tests that check several behaviours

This commit is contained in:
2026-11-08 23:01:40 +01:00
parent d8e43bc0fc
commit 40ada0788a
8 changed files with 52 additions and 29 deletions
+3 -2
View File
@@ -100,8 +100,9 @@ class Script(unittest.TestCase):
def test_warns_on_the_status_line_for_input_that_is_not_a_json_object(self):
for stdin in ("not json", "[]"):
ran = self.run_script(stdin)
self.assertEqual((ran.returncode, ran.stdout, ran.stderr), (0, f"{RED}warning: statusline.py's input is not a JSON object{RESET}", ""))
with self.subTest(stdin=stdin):
ran = self.run_script(stdin)
self.assertEqual((ran.returncode, ran.stdout, ran.stderr), (0, f"{RED}warning: statusline.py's input is not a JSON object{RESET}", ""))
def run_on_branch(self, branch):
with tempfile.TemporaryDirectory() as checkout: