From 9e25a57ebe9141fc9826fdef0c6791c0d3b0d899 Mon Sep 17 00:00:00 2001 From: junboli Date: Wed, 22 Nov 2017 14:42:30 +0800 Subject: [PATCH] Add docs for running a single test Add docs to elaborate on running a single test, running all test in a file or use regular expressions to run any matching tests. Change-Id: I78f3a24e01b0f5e36c6edd76cc0579ba1e4f06cb --- README.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.rst b/README.rst index c087f292c2..242f4d5358 100644 --- a/README.rst +++ b/README.rst @@ -193,6 +193,25 @@ Tempest suite. Alternatively, there are the py27 and py35 tox jobs which will run the unit tests with the corresponding version of python. +One common activity is to just run a single test, you can do this with tox +simply by specifying to just run py27 or py35 tests against a single test:: + + $ tox -e py27 -- -n tempest.tests.test_microversions.TestMicroversionsTestsClass.test_config_version_none_23 + +Or all tests in the test_microversions.py file:: + + $ tox -e py27 -- -n tempest.tests.test_microversions + +You may also use regular expressions to run any matching tests:: + + $ tox -e py27 -- test_microversions + +Additionally, when running a single test, or test-file, the ``-n/--no-discover`` +argument is no longer required, however it may perform faster if included. + +For more information on these options and details about stestr, please see the +`stestr documentation `_. + Python 2.6 ----------