Test that a refusal names the plan's file and the bad --release

This commit is contained in:
2026-11-14 16:09:55 +01:00
parent a040b1e882
commit e4ac0dead0
2 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -364,7 +364,11 @@ class List(TodoItem):
self.assertEqual(self.run_main("list"), (0, f"{self.todo} holds no item.\n", ""))
def test_fails_on_a_release_that_is_no_version(self):
self.assertEqual(self.exit_code("list", "--release", "next"), 2)
errors = io.StringIO()
with contextlib.redirect_stderr(errors), self.assertRaises(SystemExit) as raised:
main.main(["list", "--release", "next"], self.folder, io.StringIO())
self.assertEqual(raised.exception.code, 2)
self.assertIn("argument --release: 'next' is not a semver version", errors.getvalue())
def test_changes_no_file(self):
before = self.todo.read_text()