Chris Ball | 10 Jul 2012 02:41
Picon
Picon

[tox] Positional arguments

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'

This is my tox.ini:

 [tox]
 envlist=py26

 [testenv]
 commands=python test.py {posargs:}

(Continue reading)

holger krekel | 10 Jul 2012 08:30
Picon
Favicon

Re: [tox] Positional arguments

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,
(Continue reading)


Gmane