Skip to content

Commit c93b80e

Browse files
committed
Ready to review
1 parent a65569c commit c93b80e

File tree

4 files changed

+166
-48
lines changed

4 files changed

+166
-48
lines changed

codeflash/cli_cmds/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ def process_pyproject_config(args: Namespace) -> Namespace:
123123
"disable_telemetry",
124124
"disable_imports_sorting",
125125
"git_remote",
126+
"override_fixtures",
126127
]
127128
for key in supported_keys:
128129
if key in pyproject_config and (
129130
(hasattr(args, key.replace("-", "_")) and getattr(args, key.replace("-", "_")) is None)
130131
or not hasattr(args, key.replace("-", "_"))
131132
):
132133
setattr(args, key.replace("-", "_"), pyproject_config[key])
133-
args.override_fixtures = pyproject_config.get("override_fixtures", False)
134134
assert args.module_root is not None, "--module-root must be specified"
135135
assert Path(args.module_root).is_dir(), f"--module-root {args.module_root} must be a valid directory"
136136
assert args.tests_root is not None, "--tests-root must be specified"

codeflash/cli_cmds/cmd_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,11 @@ def configure_pyproject_toml(setup_info: SetupInfo) -> None:
723723
formatter_cmds.append("disabled")
724724
check_formatter_installed(formatter_cmds, exit_on_failure=False)
725725
codeflash_section["formatter-cmds"] = formatter_cmds
726-
codeflash_section["override-fixtures"] = False # don't override fixtures by default, let the user decide
727726
# Add the 'codeflash' section, ensuring 'tool' section exists
728727
tool_section = pyproject_data.get("tool", tomlkit.table())
729728
tool_section["codeflash"] = codeflash_section
730729
pyproject_data["tool"] = tool_section
730+
731731
with toml_path.open("w", encoding="utf8") as pyproject_file:
732732
pyproject_file.write(tomlkit.dumps(pyproject_data))
733733
click.echo(f"✅ Added Codeflash configuration to {toml_path}")

codeflash/code_utils/code_replacer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ def visit_Module(self, node: cst.Module) -> None:
5454
for import_alias in stmt.names:
5555
if isinstance(import_alias, cst.ImportAlias) and import_alias.name.value == "pytest":
5656
self.has_pytest_import = True
57-
elif isinstance(stmt, cst.ImportFrom) and stmt.module and stmt.module.value == "pytest":
58-
self.has_pytest_import = True
5957

6058
def leave_Module(self, original_node: cst.Module, updated_node: cst.Module) -> cst.Module: # noqa: ARG002
6159
"""Add pytest import if not present."""

0 commit comments

Comments
 (0)