[TIP] tox: output redirection

André Caron andre.l.caron at gmail.com
Mon Jan 25 12:51:50 PST 2016


BTW, if really do need to use a shell script, you can also remove the .sh
extension for the Linux script and call ./script (the .bat extension is
optional on Windows).

André

On Mon, Jan 25, 2016 at 2:47 PM, holger krekel <holger at merlinux.eu> wrote:

> On Mon, Jan 25, 2016 at 15:38 +0300, anatoly techtonik wrote:
> > On Mon, Jan 25, 2016 at 1:12 PM, holger krekel <holger at merlinux.eu>
> wrote:
> > > On Mon, Jan 25, 2016 at 13:08 +0300, anatoly techtonik wrote:
> > >> Hi,
> > >>
> > >> I need to redirect the result of test to a file, but tox errors out
> > >> with invocation
> > >> error:
> > >>
> > >>     ...
> > >>     py35 runtests: commands[3] | C:\hexdump\.tox\py35\Scripts\python
> > >> hexdump.py -r data/hexdump-wireshark.txt > hexdump-wireshark.bin
> > >>     Usage:
> > >>       hexdump.py [binfile|-]
> > >>       hexdump.py -r hexfile
> > >>       hexdump.py --test [logfile]
> > >>
> > >>     Options:
> > >>       --version      show program's version number and exit
> > >>       -h, --help     show this help message and exit
> > >>       -r, --restore  restore binary from hex dump
> > >>       --test         run hexdump sanity checks
> > >>     ERROR: InvocationError: 'C:\\hexdump\\.tox\\py35\\Scripts\\python
> > >> hexdump.py -r data/hexdump-wireshark.txt > hexdump-wireshark.bin'
> > >>
> > >>
> > >> Looks like tox doesn't support output redirection. What are my
> options?
> > >>
> > >>   [tox]
> > >>   envlist = py27, py35
> > >>
> > >>   [testenv]
> > >>   commands =
> > >>     {envpython} hexdump.py -r data/hexdump-wireshark.txt >
> hexdump-wireshark.bin
> > >
> > > Writing a script and calling that from commands and which does the
> output redirection.
> > > Or doing a PR that introduces output redirection to tox commands.
> >
> > I thought about script, but because scripts on Linux and Windows are
> > different, how can I run this script.bat  on Windows and script.sh on
> > Linux with tox?
>
> use python, luke! :)
>
> you can run {envpython} somepythonscript.py
>
> holger
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20160125/c3c423d3/attachment.htm>


More information about the testing-in-python mailing list