diff --git a/tests/test_traverse_project.py b/tests/test_traverse_project.py index 78a37662..93f694c6 100644 --- a/tests/test_traverse_project.py +++ b/tests/test_traverse_project.py @@ -58,7 +58,7 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]: find_sources_vectors = [ TraverseProjectVector( - "default_traversal_in_empty_project_yields__nothing", "empty" + "default_traversal_in_empty_project__yields_nothing", "empty" ), TraverseProjectVector( "traverse_nothing_in_non_empty_project__yields_nothing", @@ -67,6 +67,17 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]: deps=set(), pyenvs=set(), ), + TraverseProjectVector( + "default_traversal_in_pixi_default_example__yields_nothing", + "pixi_default_example", + expect_imports_src={"main.py"}, + expect_deps_src={"pixi.toml"}, + # TODO? Cannot auto-detect Pixi/Python environment inside + # .pixi/envs/default/, as .pixi/ itself is not the root of the + # environment (like .venv/ typically is), and we do not descend into + # dot-paths by default. + # expect_pyenv_src={".pixi/envs/default/lib/python3.12/site-packages"}, # noqa: ERA001 + ), # # Testing 'code' alone: # @@ -258,6 +269,14 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]: pyenvs=set(), expect_deps_src={"subdir1/setup.cfg", "subdir2/setup.py"}, ), + TraverseProjectVector( + "given_deps_as_pixi_toml__yields_file", + "pixi_default_example", + code=set(), + deps={"pixi.toml"}, + pyenvs=set(), + expect_deps_src={"pixi.toml"}, + ), # # Test interaction of 'deps_parser_choice' and 'deps' as file vs dir # @@ -557,6 +576,17 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]: }, skip_me=not_on_windows("Windows-style venvs skipped on POSIX"), ), + TraverseProjectVector( + "given_dot_pixi__finds_pyenv_inside_dot_pixi", + "pixi_pyproject_example", + code=set(), + deps=set(), + pyenvs={".pixi"}, + expect_pyenv_src={ + ".pixi/envs/default/lib/python3.1/site-packages", + ".pixi/envs/default/lib/python3.12/site-packages", + }, + ), # # Test interaction of 'pyenvs' with 'code' and 'deps': # @@ -662,6 +692,17 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]: }, skip_me=not_on_windows("Windows-style venvs skipped on POSIX"), ), + TraverseProjectVector( + "given_pyenv_dot_pixi__finds_everything_inside_pixi_project", + "pixi_default_example", + pyenvs={".pixi"}, + expect_imports_src={"main.py"}, + expect_deps_src={"pixi.toml"}, + expect_pyenv_src={ + ".pixi/envs/default/lib/python3.1/site-packages", + ".pixi/envs/default/lib/python3.12/site-packages", + }, + ), # # Test invalid 'exclude': #