also nested tests dir

This commit is contained in:
ali 2025-10-04 23:33:01 +03:00
parent 70d648fb09
commit 7882edce93
No known key found for this signature in database
GPG key ID: 44F9B42770617B9B
2 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
[tool.codeflash]
# All paths are relative to this pyproject.toml's directory.
module-root = "src/app"
tests-root = "tests"
tests-root = "src/tests"
test-framework = "pytest"
ignore-paths = []
disable-telemetry = true

View file

@ -28,14 +28,14 @@ def test_mirror_paths_for_worktree_mode(monkeypatch: pytest.MonkeyPatch):
optimizer.mirror_paths_for_worktree_mode(worktree_dir)
assert optimizer.args.project_root == worktree_dir / "src"
assert optimizer.args.test_project_root == worktree_dir
assert optimizer.args.test_project_root == worktree_dir / "src"
assert optimizer.args.module_root == worktree_dir / "src" / "app"
assert optimizer.args.tests_root == worktree_dir / "tests"
assert optimizer.args.tests_root == worktree_dir / "src" / "tests"
assert optimizer.args.file == worktree_dir / "src" / "app" / "main.py"
assert optimizer.test_cfg.tests_root == worktree_dir / "tests"
assert optimizer.test_cfg.tests_root == worktree_dir / "src" / "tests"
assert optimizer.test_cfg.project_root_path == worktree_dir / "src" # same as project_root
assert optimizer.test_cfg.tests_project_rootdir == worktree_dir # same as test_project_root
assert optimizer.test_cfg.tests_project_rootdir == worktree_dir / "src" # same as test_project_root
# test on our repo
monkeypatch.setattr("codeflash.optimization.optimizer.git_root_dir", lambda: repo_root)