How to run only one test in tox?

As written by jason meridth: $ tox -e py35 — project/tests/test_file.py::TestClassName::test_method But the fine grain is mentioned by beluga.me in the comments: If you have a tox.ini file you might need to add the {posargs} to pytest in tox.ini: [tox] envlist = py35 [testenv] deps = pytest pytest-cov pytest-pep8 commands = pip install -e . … Read more

pip install test dependencies for tox from setup.py

I’ve achieved this by committing a slight abuse of extra requirements. You were almost there trying the extras syntax, just that tests_require deps aren’t automatically available that way. With a setup.py like this: from setuptools import setup test_deps = [ ‘coverage’, ‘pytest’, ] extras = { ‘test’: test_deps, } setup( # Other metadata… tests_require=test_deps, extras_require=extras, … Read more