Repository navigation
Description
Problem or Motivation
Issue #3769 asks that the command tests patch no name inside devops_cli. This item covers group 2 of #3769: the tests of the pr, gh and repos commands.
An AST count at origin/main 74ba76b finds 266 string patches of a devops_cli name in these files:
tests/commands/test_pr_cmd.py: 84tests/commands/test_pr_update.py: 51tests/commands/test_gh_cmd.py: 53tests/commands/test_repos.py: 41tests/commands/test_pr_dry_run.py: 7tests/commands/test_pr_form_check.py: 9tests/commands/test_pr_status.py: 9tests/commands/test_pr_title_labels.py: 6tests/commands/test_github_milestones.py: 6
The patches replace run_gh, check_binary, load_settings, get_repo_origin_name, time.sleep and private helpers of the commands. They break the rule of docs/TESTING.md, and they stop #1336 from turning its ratchet into a ban.
Expected Behavior
Each test reaches the edge of its command through the shared fake: process_fake, git_fake, github_api, GitHubFake, the clock fake, or the config fixture. No test patches a devops_cli name. Logic that sits in a command behind a private helper moves behind a public function in its domain package only where the test needs it.
Acceptance criteria
- The test files named above hold no string patch of a
devops_cliname. - Every test of these files keeps its node id, unless the old name was wrong. The behavior that each test checks does not change.
- Product mutations in a scratch copy make the migrated tests fail.
- The pull request states the count of patches before and after.
Existing tool considered
No new tool is needed. The fakes of tests/support/fakes/, the config fixture and pytest cover the need.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(cli)scope of the title gives the scope.It unblocks #1336 and enforces the TESTING.md rule, but it is a refactor with no user-facing defect.It makes 266 test patches use shared fakes, improving maintainability and unblocking the ban in #1336.266 patch sites across 9 files must be rewritten to use process_fake, git_fake, github_api, or the config fixture.Both remove internal patches from command tests; #3769 covers all groups, this candidate covers only the pr, gh and repos files.