[Pytest-commit] Issue #310: posargs fails when providing arguments with spaces in quotes (hpk42/tox)

Ian Cordasco issues-reply at bitbucket.org
Sun Feb 7 11:22:46 EST 2016


New issue 310: posargs fails when providing arguments with spaces in quotes
https://bitbucket.org/hpk42/tox/issues/310/posargs-fails-when-providing-arguments

Ian Cordasco:

An example tox.ini

```
[testenv:venv]
deps =
    flake8
commands = flake8 {posargs}
```

And the usage

```
$ tox -e venv -- --format="%(code)s:%(path)s:%(row)s:%(col)s: %(text)s"
$ tox -e venv -- --format='%(code)s:%(path)s:%(row)s:%(col)s: %(text)s'
```

In both cases `%(text)s` is not passed as part of the argument to `--format` but instead is passed as an argument as if the user did instead

```
$ tox -e venv -- --format="%(code)s:%(path)s:%(row)s:%(col)s:" "%(text)s"
```

No amount of escaping (either of the space or the quotes) works. What does work, however, is:

```
$ tox -e venv -- --format="'%(code)s:%(path)s:%(row)s:%(col)s: %(text)s'"
```

In other words, using both types of quotes works.

I looked but didn't see this reported anywhere else and I'm frankly not certain this is something that can be fixed.




More information about the pytest-commit mailing list