Skip to content

Commit

Permalink
Add changelog and test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzolf committed Dec 10, 2022
1 parent a0ce86c commit 8886dc7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/2658.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fail on ''pass_env/passenv'' entries containing blanks, detecting missing commas
20 changes: 20 additions & 0 deletions tests/tox_env/test_tox_env_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ def test_tox_env_pass_env_literal_miss() -> None:
assert not env


def test_tox_env_pass_env_fail(tox_project: ToxProjectCreator) -> None:
prj = tox_project(
{
"tox.ini": """[testenv]
passenv = MYENV YOURENV, THEIRENV
commands=python -c 'import os; print("MYENV", os.getenv("MYENV"))'""",
},
)

result = prj.run("r")

result.assert_failed(1)
out = (
r"py: failed with pass_env/passenv variable can't have values "
r"containing blanks like \['MYENV YOURENV'\]; "
r"a comma is possibly missing.*"
)
result.assert_out_err(out=out, err="", regex=True)


@pytest.mark.parametrize("glob", ["*", "?"])
@pytest.mark.parametrize("char", ["a", "A"])
def test_tox_env_pass_env_match_ignore_case(char: str, glob: str) -> None:
Expand Down

0 comments on commit 8886dc7

Please sign in to comment.