From 29380c233498e6c5c42869326163c15d4093ac92 Mon Sep 17 00:00:00 2001 From: Mark Ferry Date: Thu, 19 Jan 2023 12:41:16 +0200 Subject: [PATCH] Revert "Override toxworkdir with --workdir. (#2776)" This reverts commit bf87bea75f2becbbcb29346567e6bf249da2b063. --- src/tox/config/sets.py | 4 ---- tests/config/test_sets.py | 8 -------- 2 files changed, 12 deletions(-) diff --git a/src/tox/config/sets.py b/src/tox/config/sets.py index 98a31251f..e07f4bd40 100644 --- a/src/tox/config/sets.py +++ b/src/tox/config/sets.py @@ -191,14 +191,10 @@ def register_config(self) -> None: def work_dir_builder(conf: Config, env_name: str | None) -> Path: # noqa: U100 return (conf.work_dir if conf.work_dir is not None else cast(Path, self["tox_root"])) / ".tox" - def work_dir_post_process(value: Path) -> Path: - return self._conf.work_dir if self._conf.options.work_dir else value - self.add_config( keys=["work_dir", "toxworkdir"], of_type=Path, default=work_dir_builder, - post_process=work_dir_post_process, desc="working directory", ) self.add_config( diff --git a/tests/config/test_sets.py b/tests/config/test_sets.py index f739b074f..0faa68acd 100644 --- a/tests/config/test_sets.py +++ b/tests/config/test_sets.py @@ -171,11 +171,3 @@ def test_set_env_raises_on_non_str(mocker: MockerFixture) -> None: env_set.loaders.insert(0, MemoryLoader(set_env=1)) with pytest.raises(TypeError, match="1"): assert env_set["set_env"] - - -@pytest.mark.parametrize("work_dir", ["a", ""]) -def test_config_work_dir(tox_project: ToxProjectCreator, work_dir: str) -> None: - project = tox_project({"tox.ini": "[tox]\ntoxworkdir=b"}) - result = project.run("c", *(["--workdir", str(project.path / work_dir)] if work_dir else [])) - expected = project.path / work_dir if work_dir else Path("b") - assert expected == result.state.conf.core["work_dir"]