Skip to content

Commit 8025ffa

Browse files
committed
Ignore __testdata__ directory in package lookup if it's not a test session
1 parent 399d8ec commit 8025ffa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/finecode/workspace_manager/config/read_configs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ async def read_projects_in_dir(
1818
new_projects: list[domain.Project] = []
1919
def_files_generator = dir_path.rglob("pyproject.toml")
2020
for def_file in def_files_generator:
21+
# ignore definition files in `__testdata__` directory, projects in test data
22+
# can be started only in tests, not from outside
23+
# TODO: make configurable?
24+
# path to definition file relative to workspace directory in which this
25+
# definition was found
26+
def_file_rel_dir_path = def_file.relative_to(dir_path)
27+
if '__testdata__' in def_file_rel_dir_path.parts:
28+
logger.debug(f"Skip '{def_file}' because it is in test data and it is not a test session")
29+
continue
30+
2131
status = domain.ProjectStatus.READY
2232
actions: list[domain.Action] | None = None
2333

0 commit comments

Comments
 (0)