diff options
author | Bernát Gábor <gaborjbernat@gmail.com> | 2022-12-03 19:16:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-03 19:16:56 -0800 |
commit | 932bb3e608694bee0017846b5e3f9856667ce476 (patch) | |
tree | a3d8248a072e876d82883bf4d2c23b333a4567be /tests/config | |
parent | f4b43b589bc3f1ee612224156cf027c7b6d6d6d3 (diff) | |
download | tox-git-932bb3e608694bee0017846b5e3f9856667ce476.tar.gz |
Ensure paths constructed by tox stay meaningful (#2587)
Resolves https://github.com/tox-dev/tox/issues/2562
Diffstat (limited to 'tests/config')
-rw-r--r-- | tests/config/test_main.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/config/test_main.py b/tests/config/test_main.py index f77f92ca..cff7d2f4 100644 --- a/tests/config/test_main.py +++ b/tests/config/test_main.py @@ -1,6 +1,7 @@ from __future__ import annotations import os +from pathlib import Path from tests.conftest import ToxIniCreator from tox.config.loader.api import Override @@ -83,3 +84,19 @@ def test_args_are_paths_when_with_change_dir(tox_project: ToxProjectCreator) -> result = project.run("c", "-e", "py", "-k", "commands", "--", *args) result.assert_success() assert result.out == f"[testenv:py]\ncommands = magic.py {project.path} ..{os.sep}tox.ini a.txt . ..\n" + + +def test_relative_config_paths_resolve(tox_project: ToxProjectCreator) -> None: + project = tox_project({"tox.ini": "[tox]"}) + result = project.run( + "c", + "-c", + str(Path(project.path.name) / "tox.ini"), + "-k", + "change_dir", + "env_dir", + from_cwd=project.path.parent, + ) + result.assert_success() + expected = f"[testenv:py]\nchange_dir = {project.path}\nenv_dir = {project.path / '.tox' / 'py'}\n\n[tox]\n" + assert result.out == expected |