Skip to content

Commit 1b8ecc2

Browse files
andreifgaborbernat
authored andcommitted
Exclude inline comments from envlist (tox-dev#680)
* Make test failing by adding inline comment. * Exclude inline comments from envlist.
1 parent 95c9b73 commit 1b8ecc2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ def test_listenvs_all_verbose_description(self, cmd, initproj):
21802180
initproj('listenvs_all_verbose_description', filedefs={
21812181
'tox.ini': '''
21822182
[tox]
2183-
envlist={py27,py36}-{windows,linux}
2183+
envlist={py27,py36}-{windows,linux} # py26
21842184
[testenv]
21852185
description= py27: run pytest on Python 2.7
21862186
py36: run pytest on Python 3.6

tox/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,8 @@ def _getenvdata(self, reader):
906906
def _split_env(env):
907907
"""if handed a list, action="append" was used for -e """
908908
if not isinstance(env, list):
909-
if '\n' in env:
910-
env = ','.join(env.split('\n'))
909+
env = [e.split('#', 1)[0].strip() for e in env.split('\n')]
910+
env = ','.join([e for e in env if e])
911911
env = [env]
912912
return mapcat(_expand_envstr, env)
913913

0 commit comments

Comments
 (0)