[TIP] [tox] Positional arguments
holger krekel
holger at merlinux.eu
Mon Jul 9 23:30:27 PDT 2012
Hi Chris,
On Tue, Jul 10, 2012 at 00:41 +0000, Chris Ball wrote:
> Hi,
>
> I'd like to have tox call a script (test.py) to start some tests. test.py takes
> some arguments, but any arguments after "--" are passed to a script (script.py)
> that's called by test.py. I can't work out how to supply arguments to tox that
> are passed all the way through to script.py.
>
> I'll try to make that clearer!
>
> $ python test.py -- --version
> passes "--version" to script.py.
>
> I thought if I started tox like this:
> $ tox -- -- --version
> that --version would be passed to script.py. However, I get:
> ...
> [TOX] $ .tox/py26/bin/python test.py --version
> Usage: test.py [options]
>
> test.py: error: no such option: --version
> [TOX] ERROR: InvocationError: '.tox/py26/bin/python test.py --version'
Yes, it seems tox or rather the underlying argparse library looses
the double "--". Probably an issue to post with the argparse library
i am afraid.
best,
holger
More information about the testing-in-python
mailing list