Skip to content
5 changes: 4 additions & 1 deletion codeflash/cli_cmds/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def init_codeflash() -> None:

if should_modify_pyproject_toml():
setup_info: SetupInfo = collect_setup_info()

if Path(setup_info.module_root).resolve() == Path(setup_info.tests_root).resolve():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do it when the user is actually entering the test directory, not after he is done.
Also remove the module_root path from the list of options when asking for the test_root. This will mostly solve the problem. We can still keep the warning in case the user enters the module_root path manually

logger.warning(
"It looks like your tests root is the same as your module root. This is not recommended and can lead to unexpected behavior."
)
configure_pyproject_toml(setup_info)

install_github_app()
Expand Down
Loading