Skip to content

Commit d535b70

Browse files
committed
fixup! feat(config): Allow ranges in envlist
1 parent 310255e commit d535b70

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/tox/config/loader/ini/factor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def find_factor_groups(value: str) -> Iterator[list[tuple[str, bool]]]:
6666
yield result
6767

6868

69-
_FACTOR_RE = re.compile(r"!?[\w._][\w._-]*")
69+
_FACTOR_RE = re.compile(r"(?:!?[\w._][\w._-]*|^$)")
7070

7171

7272
def expand_env_with_negation(value: str) -> Iterator[str]:

tests/config/loader/ini/test_factor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ def test_factor_config_no_env_list_creates_env(tox_ini_conf: ToxIniCreator) -> N
213213
),
214214
("py3{10-11},a{1-2}-b{3-4}", ["py310", "py311", "a1-b3", "a1-b4", "a2-b3", "a2-b4"]),
215215
("py3{13-11}", ["py313", "py312", "py311"]),
216+
("py3{-11}", ["py3-11"]),
217+
("foo{11-}", ["foo11-"]),
218+
("foo{a-}", ["fooa-"]),
219+
("foo{-a}", ["foo-a"]),
220+
("foo{a-11}", ["fooa-11"]),
221+
("foo{13-a}", ["foo13-a"]),
222+
("foo{a-b}", ["fooa-b"]),
216223
],
217224
)
218225
def test_env_list_expands_ranges(env_list: str, expected_envs: list[str], tox_ini_conf: ToxIniCreator) -> None:

0 commit comments

Comments
 (0)