Skip to content

Commit 8f3cc41

Browse files
committed
Add tests for expanding ranges in setenv and deps
1 parent 721d3c7 commit 8f3cc41

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/config/loader/ini/test_factor.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,40 @@ def test_ini_loader_raw_with_factors(
273273
assert outcome == result
274274

275275

276+
def test_generative_ranges_in_deps(tox_ini_conf: ToxIniCreator) -> None:
277+
config = tox_ini_conf(
278+
"""
279+
[testenv]
280+
deps-x =
281+
py{310-314}: black
282+
""",
283+
)
284+
assert list(config) == ["py310", "py311", "py312", "py313", "py314"]
285+
286+
287+
def test_generative_ranges_in_deps_with_mixed_approach(tox_ini_conf: ToxIniCreator) -> None:
288+
config = tox_ini_conf(
289+
"""
290+
[testenv]
291+
deps-x =
292+
py3{10-14}: black
293+
""",
294+
)
295+
assert list(config) == ["py310", "py311", "py312", "py313", "py314"]
296+
297+
298+
def test_generative_ranges_in_setenv(tox_ini_conf: ToxIniCreator) -> None:
299+
config = tox_ini_conf(
300+
"""
301+
[testenv]
302+
setenv =
303+
foo{1,2}: FOO=bar
304+
foo{3-5}: FOO=baz
305+
""",
306+
)
307+
assert list(config) == ["foo1", "foo2", "foo3", "foo4", "foo5"]
308+
309+
276310
def test_generative_section_name_with_ranges(tox_ini_conf: ToxIniCreator) -> None:
277311
config = tox_ini_conf(
278312
"""

0 commit comments

Comments
 (0)