Title: agent: always use exact equality when testing console message output · Issue #1866 · usethis-python/usethis-python · GitHub
Open Graph Title: agent: always use exact equality when testing console message output · Issue #1866 · usethis-python/usethis-python
X Title: agent: always use exact equality when testing console message output · Issue #1866 · usethis-python/usethis-python
Description: What happened When adding new code paths that emit console messages, the agent wrote tests using assert "..." in out (substring checks) instead of exact equality assertions. The reviewer had to request a fix via code review comment. Root...
Open Graph Description: What happened When adding new code paths that emit console messages, the agent wrote tests using assert "..." in out (substring checks) instead of exact equality assertions. The reviewer had to req...
X Description: What happened When adding new code paths that emit console messages, the agent wrote tests using assert "..." in out (substring checks) instead of exact equality assertions. The reviewer ...
Opengraph URL: https://github.com/usethis-python/usethis-python/issues/1866
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"agent: always use exact equality when testing console message output","articleBody":"## What happened\n\nWhen adding new code paths that emit console messages, the agent wrote tests using `assert \"...\" in out` (substring checks) instead of exact equality assertions. The reviewer had to request a fix via code review comment.\n\n## Root cause\n\nThe `usethis-python-test-full-coverage` skill was not invoked during test writing. The agent interpreted the AGENTS.md instruction — which says to \"ALWAYS consider the skill to be relevant\" — as permission to evaluate relevance and decide not to use it, rather than as a mandate to always apply it.\n\n## Generalised principle\n\nTwo rules must be observed for all code involving console output:\n\n1. **Always invoke the `usethis-python-test-full-coverage` skill when writing or modifying any code.** The word \"consider\" in the skill instruction means \"treat as always applicable\", not \"decide whether to apply\". There is no scenario where this skill is not relevant when code is being changed.\n2. **Never use substring checks (`assert \"...\" in out`) for console-output tests.** Always assert the exact output string with equality (`assert out == \"...\"`), and set the backend explicitly (e.g. via `usethis_config.set(backend=...)`) so the result is deterministic. Substring checks allow partial coverage to hide missing output and fail to detect unexpected extra messages.\n\n## Resolution\n\nThe `test_no_git_repo` tests were updated to use exact equality assertions with an explicit backend, and the `# noqa: RUF001` suppression was placed on the line containing the ℹ character.\n\n## Follow-up\n\nConsider strengthening the AGENTS.md wording for the `usethis-python-test-full-coverage` skill from \"ALWAYS consider the skill to be relevant\" to something unambiguous such as \"ALWAYS invoke this skill — it is mandatory for any code change, without exception.\"","author":{"url":"https://github.com/nathanjmcdougall","@type":"Person","name":"nathanjmcdougall"},"datePublished":"2026-04-07T18:01:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1866/usethis-python/issues/1866"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e7e7732c-26f2-f5d1-a3fa-dcda2698c1b4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94DA:153AB:1B6BAB:25D3C9:6A4DF0AF |
| html-safe-nonce | 63e1db1fae28a1363443a975454375b9f72ff4b79ae0dea56ee698d6b96f5c36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NERBOjE1M0FCOjFCNkJBQjoyNUQzQzk6NkE0REYwQUYiLCJ2aXNpdG9yX2lkIjoiNTkyMjkxMTc3MzAxMTA3OTM0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 37a7fc01a8413e155367fece32b25f0a336c284b901ec3747716a7789d03994c |
| hovercard-subject-tag | issue:4219643113 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/usethis-python/usethis-python/1866/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d1dbd3158fa1b3af2b12b33da83518800cd13d8e6c05789cdecf37ab2d566ef0/usethis-python/usethis-python/issues/1866 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d1dbd3158fa1b3af2b12b33da83518800cd13d8e6c05789cdecf37ab2d566ef0/usethis-python/usethis-python/issues/1866 |
| og:image:alt | What happened When adding new code paths that emit console messages, the agent wrote tests using assert "..." in out (substring checks) instead of exact equality assertions. The reviewer had to req... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nathanjmcdougall |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5818716c93c6a2925b815402541a32814e43a7b1261c322b0c2df75224289566 |
| turbo-cache-control | no-preview |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f4bb89367ca678f057d79b1abc45d6675b1bd5b2 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width