File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff 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
4849def parse_config_file (
You can’t perform that action at this time.
0 commit comments