Specify where to install ‘tests_require’ dependencies of a distribute/setuptools package

You cannot specify where the test requirements are installed. The whole point of the tests_require parameter is to specify dependencies that are not required for the installation of the package but only for running the tests (as you can imagine many consumers might want to install the package but not run the tests). If you want the test requirements to be included during installation, I would include them in the install_requires parameter. For example:

test_requirements = ['pytest>=2.1', 'dingus']
    # ...
    tests_require = test_requirements,
    install_requires = [
        # ... (your usual install requirements)
    ] + test_requirements,

As far as I know, there’s no parameter you can pass to force this behavior without changing the setup script.

Leave a Comment