Skip to content
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 docs/changelog/2718.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix space not accepted in factor filter expression - by :user:`gaborbernat`.
2 changes: 1 addition & 1 deletion src/tox/config/loader/ini/factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def explode_factor(group: list[tuple[str, bool]]) -> str:

def expand_factors(value: str) -> Iterator[tuple[Iterator[list[tuple[str, bool]]] | None, str]]:
for line in value.split("\n"):
match = re.match(r"^((?P<factor_expr>[\w{}.!,-]+):\s+)?(?P<content>.*?)$", line)
match = re.match(r"^((?P<factor_expr>[\w {}.!,-]+):\s+)?(?P<content>.*?)$", line)
if match is None: # pragma: no cover
raise RuntimeError("for a valid factor regex this cannot happen")
groups = match.groupdict()
Expand Down
2 changes: 2 additions & 0 deletions tests/config/loader/ini/test_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def complex_example() -> str:
py: py only
!py: not py
{py,!pi}-{a,b}{,-dev},c: complex
py, d: space
extra: extra
more-default
""",
Expand All @@ -46,6 +47,7 @@ def test_factor_env_discover(complex_example: str) -> None:
"pi-b",
"pi-b-dev",
"c",
"d",
"extra",
]

Expand Down