MCPcopy
hub / github.com/tox-dev/tox / test_custom_root_dir

Function test_custom_root_dir

tests/test_run.py:60–82  ·  view source on GitHub ↗
(tox_project: ToxProjectCreator, tmp_path: Path)

Source from the content-addressed store, hash-verified

58
59
60def test_custom_root_dir(tox_project: ToxProjectCreator, tmp_path: Path) -> None:
61 project = tox_project({})
62
63 expected_tox_root = tmp_path
64 expected_work_dir = expected_tox_root / ".tox"
65
66 outcome = project.run("c", "--root", str(expected_tox_root))
67 outcome.assert_success()
68
69 assert outcome.state.conf.options.root_dir == expected_tox_root, "should parse the --root argument"
70
71 assert outcome.state.conf.core["tox_root"] == expected_tox_root, f"should set tox_root to {expected_tox_root}"
72
73 # values that depend on tox_root should also be updated
74
75 assert outcome.state.conf.core["work_dir"] == expected_work_dir
76 assert outcome.state.conf.core["temp_dir"] == expected_work_dir / ".tmp"
77
78 env_conf = outcome.state.conf.get_env("py")
79
80 assert env_conf["env_dir"] == expected_work_dir / "py"
81 assert env_conf["env_log_dir"] == expected_work_dir / "py" / "log"
82 assert env_conf["env_tmp_dir"] == expected_work_dir / "py" / "tmp"
83
84
85def test_custom_root_dir_and_work_dir(tox_project: ToxProjectCreator, tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 3

get_envMethod · 0.80
runMethod · 0.45
assert_successMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…