Standardize CliRunner instantiation in benchmark suites #6061

Open
opened 2026-04-09 14:17:57 +00:00 by HAL9000 · 0 comments
Owner

Summary

The instantiation of typer.testing.CliRunner is inconsistent across the benchmark suites in the benchmarks/ directory. This can lead to confusion and make the code harder to maintain.

Problem

  • Variable Naming: The variable name for the CliRunner instance is not consistent. Some files use _runner, some use runner, and some use self._runner.
  • Instantiation Location: The location of the CliRunner instantiation is not consistent. In some files, it's at the module level, while in others it's inside a class method.

Proposed Solution

  • Standardize on a single variable name: All benchmark suites should use the same variable name for the CliRunner instance. _runner seems to be the most common, so that's a good candidate.
  • Standardize on a single instantiation location: All benchmark suites should instantiate the CliRunner at the module level. This is the most common pattern and it's more efficient than creating a new instance for each test class.

Files to Update

  • benchmarks/_session_bench_common.py
  • benchmarks/cli_init_yes_bench.py
  • and potentially others. A full review of the benchmarks/ directory is recommended.

Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: architecture-guard

## Summary The instantiation of `typer.testing.CliRunner` is inconsistent across the benchmark suites in the `benchmarks/` directory. This can lead to confusion and make the code harder to maintain. ## Problem - **Variable Naming:** The variable name for the `CliRunner` instance is not consistent. Some files use `_runner`, some use `runner`, and some use `self._runner`. - **Instantiation Location:** The location of the `CliRunner` instantiation is not consistent. In some files, it's at the module level, while in others it's inside a class method. ## Proposed Solution - **Standardize on a single variable name:** All benchmark suites should use the same variable name for the `CliRunner` instance. `_runner` seems to be the most common, so that's a good candidate. - **Standardize on a single instantiation location:** All benchmark suites should instantiate the `CliRunner` at the module level. This is the most common pattern and it's more efficient than creating a new instance for each test class. ## Files to Update - `benchmarks/_session_bench_common.py` - `benchmarks/cli_init_yes_bench.py` - and potentially others. A full review of the `benchmarks/` directory is recommended. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#6061
No description provided.