From b971870d64fcf9808006858fd170c857b62722c9 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 31 Oct 2014 20:14:59 +1100 Subject: [PATCH] Add note on running single tests to HACKING.rst I haven't done this in a while, and I went through a number of false starts forgetting the "--", trying to specify "filename:TestClass" etc. before I got it to work. Hopefully this saves someone else some time. Change-Id: I94590009157cce8d42002089304c66c164bcd6ec --- HACKING.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HACKING.rst b/HACKING.rst index 0fb08e667075..6d16800aa571 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -68,6 +68,14 @@ Python packages may also have dependencies that are outside of tox's ability to install. Please refer to doc/source/devref/development.environment.rst for a list of those packages on Ubuntu, Fedora and Mac OS X. +To run a single or restricted set of tests, pass a regex that matches +the class name containing the tests as an extra ``tox`` argument; +e.g. ``tox -- TestWSGIServer`` (note the double-hypen) will test all +WSGI server tests from ``nova/tests/test_wsgi.py``; ``-- +TestWSGIServer.test_uri_length_limit`` would run just that test, and +``-- TestWSGIServer|TestWSGIServerWithSSL`` would run tests from both +classes. + It is also possible to run the tests inside of a virtual environment you have created, or it is possible that you have all of the dependencies installed locally already. In this case, you can interact with the testr