Repository navigation
Tests: negative assertions that could not fire, and a test that pins inbound_count - #115
Merged
Merged
Conversation
…d_count Three assertions checked that a message is absent, and the message no longer exists, so they could never fail: - test_journal_block_reports_its_position: "Could not find or create" went with the top-level fallback in 8926e36. The line is redundant: the json.loads(result.stderr) above it already requires stderr to be one JSON object, so any extra warning fails the test first. - test_keep_block_ids and test_keep_ids_every_writer: "cannot preserve" went with the note in 5860462, when top-level blocks began to keep their ids. They now check that the note which does exist, the dropped-id:: one, does not appear; its sibling tests assert the same text is there when ids are dropped. stderr is not empty in every case (add-journal-block --file prints an unrelated note), so a blanket emptiness check would break on that. test_get_page_stats_does_not_report_zero_inbound_links_after_an_error looked for '"inbound_count"' in stdout, and no test expected the field anywhere. Renaming it left the whole suite green. A new test reads the stats when the scan can read every page and expects the field and its value. Checked by mutation. Printing the dropped-id note despite --keep-ids passes the old assertions and fails the new ones in all eight cases. Renaming inbound_count passes the whole suite as it stands on main and fails the new test. Printing the old fallback warning fails the journal test with or without the removed line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three assertions checked that a message is absent, and the message no longer exists, so they could never fail:
test_journal_block_reports_its_position: "Could not find or create" went with the top-level fallback in 8926e36. The line is redundant:json.loads(result.stderr)above it already requires stderr to be one JSON object, so any extra warning fails the test first. Removed.test_keep_block_idsandtest_keep_ids_every_writer: "cannot preserve" went with the note in 5860462, when top-level blocks began to keep their ids. They now check that the note which does exist, the dropped-id::one, does not appear; their sibling tests assert the same text is there when ids are dropped.stderris not empty in every case (add-journal-block --fileprints an unrelated note), so a blanket emptiness check would break on that.test_get_page_stats_does_not_report_zero_inbound_links_after_an_errorlooked for"inbound_count"in stdout, and no test expected the field anywhere: renaming it left the whole suite green. A new test reads the stats when the scan can read every page and expects the field and its value.Checked
ruff check ..--keep-idspasses the old assertions and fails the new ones, in all eight cases.inbound_countpasses the whole suite as it stands onmainand fails the new test.Not changed:
(empty),Added block-ref,Done.and one note ininit_confighave the same kind of loose wording check; each has part of its claim covered elsewhere, and none has let anything through so far.