Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not interpolate values from tox --showconfig #1585

Merged
merged 3 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Albin Vass
Alex Grönholm
Alexander Loechel
Alexander Schepanovski
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/1585.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``tox --showconfig`` no longer tries to interpolate '%' signs.
2 changes: 1 addition & 1 deletion src/tox/session/commands/show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def show_config(config):
parser = configparser.ConfigParser()
parser = configparser.RawConfigParser()

if not config.envlist_explicit or reporter.verbosity() >= reporter.Verbosity.INFO:
tox_info(config, parser)
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/session/test_show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ def test_showconfig(cmd, setup_mixed_conf, args, expected):
assert found_sections == expected


def test_showconfig_interpolation(cmd, initproj):
initproj(
"no_interpolation",
filedefs={
"tox.ini": """
[tox]
envlist = %s
[testenv:%s]
commands = python -c "print('works')"
"""
},
)
load_config(("--showconfig",), cmd)


def test_config_specific_ini(tmpdir, cmd):
ini = tmpdir.ensure("hello.ini")
output = load_config(("-c", ini, "--showconfig"), cmd)
Expand Down