[TIP] Tox - passing tests_require from setup.py to Tox

Robert Collins robertc at robertcollins.net
Sun Nov 29 00:04:07 PST 2015

On 29 November 2015 at 17:05, Alyssa Kwan <me at alyssackwan.name> wrote:
> Hi all,
> Apologies if this has been covered before. I've looked high and low and
> can't find it, so please excuse the potentially poor Google-fu.
> I merely want to pass tests_require from setup.py (setuptools) to Tox. I'm
> using the setuptools.command.test.test extension as documented here:
> https://testrun.org/tox/latest/example/basic.html#integration-with-setuptools-distribute-test-commands.
> I tried using an env var but it broke with multiple deps. I'm sure this is
> fairly standard.
> Any help is greatly appreciated!

The testrun.org thing you link to uses tests_require to *install* tox;
any actual test dependencies you have won't be installed in your tox
managed virtual environments, because tox doesn't introspect
tests_require. You need to use the usual tox mechanisms (e.g. deps = )
to specify your test dependencies.


Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud

More information about the testing-in-python mailing list