Skip to content

Commit

Permalink
test_traverse_project: Add tests using the Conda sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
jherland committed Sep 19, 2024
1 parent 7487261 commit ea9e35d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/test_traverse_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]:
# dot-paths by default.
# expect_pyenv_src={".pixi/envs/default/lib/python3.12/site-packages"}, # noqa: ERA001
),
TraverseProjectVector(
"default_traversal_in_conda_example__yields_py_and_deps_file",
"conda_example",
expect_imports_src={"main.py"},
expect_deps_src={"environment.yml"},
),
#
# Testing 'code' alone:
#
Expand Down Expand Up @@ -277,6 +283,14 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]:
pyenvs=set(),
expect_deps_src={"pixi.toml"},
),
TraverseProjectVector(
"given_deps_as_environment_yml__yields_file",
"conda_example",
code=set(),
deps={"environment.yml"},
pyenvs=set(),
expect_deps_src={"environment.yml"},
),
#
# Test interaction of 'deps_parser_choice' and 'deps' as file vs dir
#
Expand Down Expand Up @@ -588,6 +602,20 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]:
},
skip_me=on_windows("POSIX-style Pixi environments skipped on Windows"),
),
TraverseProjectVector(
"given_dot_conda__finds_pyenv_inside_dot_conda",
"conda_example",
code=set(),
deps=set(),
pyenvs={".conda"},
# .conda/ here really is a stand-in for ~/.conda, which is where Conda
# usually keeps its environments.
expect_pyenv_src={
".conda/envs/conda_example/lib/python3.1/site-packages", # symlink
".conda/envs/conda_example/lib/python3.12/site-packages",
},
skip_me=on_windows("POSIX-style Conda environments skipped on Windows"),
),
#
# Test interaction of 'pyenvs' with 'code' and 'deps':
#
Expand Down Expand Up @@ -705,6 +733,18 @@ def not_on_windows(msg: str) -> Callable[[], Optional[str]]:
},
skip_me=on_windows("POSIX-style Pixi environments skipped on Windows"),
),
TraverseProjectVector(
"given_pyenv_dot_conda__finds_everything_inside_conda_project",
"conda_example",
pyenvs={".conda"},
expect_imports_src={"main.py"},
expect_deps_src={"environment.yml"},
expect_pyenv_src={
".conda/envs/conda_example/lib/python3.1/site-packages", # symlink
".conda/envs/conda_example/lib/python3.12/site-packages",
},
skip_me=on_windows("POSIX-style Conda environments skipped on Windows"),
),
#
# Test invalid 'exclude':
#
Expand Down

0 comments on commit ea9e35d

Please sign in to comment.