Skip to content

Commit 3652c0d

Browse files
Albin Vassssbarnea
Albin Vass
authored andcommitted
Do not interpolate values from tox --showconfig (tox-dev#1585)
1 parent 5665ce2 commit 3652c0d

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

CONTRIBUTORS

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Albin Vass
12
Alex Grönholm
23
Alexander Loechel
34
Alexander Schepanovski

docs/changelog/1585.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``tox --showconfig`` no longer tries to interpolate '%' signs.

src/tox/session/commands/show_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def show_config(config):
22-
parser = configparser.ConfigParser()
22+
parser = configparser.RawConfigParser()
2323

2424
if not config.envlist_explicit or reporter.verbosity() >= reporter.Verbosity.INFO:
2525
tox_info(config, parser)

tests/unit/session/test_show_config.py

+15
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ def test_showconfig(cmd, setup_mixed_conf, args, expected):
8989
assert found_sections == expected
9090

9191

92+
def test_showconfig_interpolation(cmd, initproj):
93+
initproj(
94+
"no_interpolation",
95+
filedefs={
96+
"tox.ini": """
97+
[tox]
98+
envlist = %s
99+
[testenv:%s]
100+
commands = python -c "print('works')"
101+
"""
102+
},
103+
)
104+
load_config(("--showconfig",), cmd)
105+
106+
92107
def test_config_specific_ini(tmpdir, cmd):
93108
ini = tmpdir.ensure("hello.ini")
94109
output = load_config(("-c", ini, "--showconfig"), cmd)

0 commit comments

Comments
 (0)