Answer prose round 1: 0 🔴, 6 🟡 (0 misread); rewrite each <verb> nothing to the negation rule, tighten the new docstrings and comments

This commit is contained in:
2026-11-12 20:33:32 +01:00
parent 7e29dc0014
commit 14e6756a53
61 changed files with 104 additions and 104 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ def waited(file: str, pattern: str | None, timeout: float, clock: Clock = time)
if text is None:
return Failure(f"{file} did not appear in {timeout:g} s")
last = line_in(text, None)
wanted = f"no line matching `{pattern}`" if pattern is not None else "nothing"
wanted = f"no line matching `{pattern}`" if pattern is not None else "no text"
return Failure(f"{file} held {wanted} after {timeout:g} s" + (f"; its last line: {last}" if last is not None else ""))
clock.sleep(min(POLL_SECONDS, left))
+1 -1
View File
@@ -90,7 +90,7 @@ class WaitFor(unittest.TestCase):
def test_an_empty_file_gives_up_saying_it_held_nothing_and_no_last_line(self):
self.file.write_text("")
clock = Clock()
self.assertEqual(main.waited(str(self.file), None, 3, clock), Failure(f"{self.file} held nothing after 3 s"))
self.assertEqual(main.waited(str(self.file), None, 3, clock), Failure(f"{self.file} held no text after 3 s"))
self.assertEqual(clock.now, 3)
def test_sleeps_only_the_time_left_before_the_timeout(self):