[TIP] How do I get tox to test extension modules?

holger krekel holger at merlinux.eu
Mon Oct 21 02:00:47 PDT 2013


On Sat, Oct 19, 2013 at 14:38 +0200, Berthold Höllmann wrote:
> berthold at xn--hllmanns-n4a.de (Berthold Höllmann) writes:
> 
> > I am trying to set up tox tests for a Project that contains a cython
> > defined extension module. I don't find a way to get the extension
> > compiled in the tox virtualenv. setup.py builds the extension, and
> > pytest finds it OK if I give the correct PYTHONPATH, but tox installs
> > the sources only but not the compiled extension:
> 
> Never mind. Adding "python setup.py install" to the testenv commands
> does the trick.

Ok, that's kind of a workaround.  tox itself only packages via sdist.
You can however instruct tox to install a pre-built package:

    tox --installpkg=path/to/package

You can write a little wrapper script that performs the build-step
and then feeds the result to tox.  At the end of a passing test run
you could send the very package archive to pypi and be sure that
the package is well tested.

HTH,
holger

> Kind regards 
> 
> Berthold
> 






> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python




More information about the testing-in-python mailing list