Skip to content

Commit 83f4354

Browse files
committed
wip
1 parent 1e9dae9 commit 83f4354

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

codeflash/code_utils/config_parser.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@ def find_pyproject_toml(config_file: Path | None = None) -> Path:
3131
raise ValueError(msg)
3232

3333

34-
def find_conftest_files(tests_path: Path) -> list[Path]:
35-
# Find the conftest file on the root of the project
36-
dir_path = Path.cwd()
37-
cur_path = tests_path
38-
list_of_conftest_files = []
39-
while cur_path != dir_path:
40-
config_file = cur_path / "conftest.py"
41-
if config_file.exists():
42-
list_of_conftest_files.append(config_file)
43-
# Search for conftest.py in the parent directories
44-
cur_path = cur_path.parent
45-
return list_of_conftest_files
34+
def find_conftest_files(test_paths: list[Path]) -> list[Path]:
35+
list_of_conftest_files = set()
36+
for test_path in test_paths:
37+
# Find the conftest file on the root of the project
38+
dir_path = Path.cwd()
39+
cur_path = test_path
40+
while cur_path != dir_path:
41+
config_file = cur_path / "conftest.py"
42+
if config_file.exists():
43+
list_of_conftest_files.add(config_file)
44+
# Search for conftest.py in the parent directories
45+
cur_path = cur_path.parent
46+
return list(list_of_conftest_files)
4647

4748

4849
def parse_config_file(

0 commit comments

Comments
 (0)