Repository :
http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
---------------------------------------------------------------
commit 95d1558e9b293e8673606308200ab82ba6f6529f
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 10 20:27:36 2012 +0100
Add possibility to specify more argument to nose by passing them to the shell script
This way you can run "./run_tests.sh -x" to add the "-x" argument
to nose which is
"stop at the first error/fail" argument.
Update documentation to reflect this possibility.
Add some more documentation on how to run single test suite from the command line
using python -m unittest
---------------------------------------------------------------
doc/development.rst | 23 +++++++++++++++++++++--
run_tests.sh | 2 +-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/doc/development.rst b/doc/development.rst
index 97d1e47..0176af9 100644
--- a/doc/development.rst
+++ b/doc/development.rst
@@ -116,6 +116,17 @@ unit-tests of the project with coverage information using
`python-nose
<
https://nose.readthedocs.org/>`_.
+.. note:: You can specify additional arguments to the nose command used
+ in this script by just passing arguments to the script.
+
+ For example you can specify the ``-x`` / ``--stop`` argument:
+ `Stop running tests after the first error or failure` by just doing
+
+ ::
+
+ ./run_tests.sh --stop
+
+
Each unit-tests files (located under ``fedocal/tests/``) can be called
by alone, allowing easier debugging of the tests. For example:
@@ -123,8 +134,16 @@ by alone, allowing easier debugging of the tests. For example:
python fedocal/tests/test_week.py
-.. note:: In order to have the coverage information you might have to
- install ``python-coverage``
+Similarly as for nose you can also ask that the unit-test stop at the first
+error or failure. For example, the command could be:
+
+::
+
+ FEDOCAL_CONFIG=tests/fedocal_test.cfg python -m unittest -f -v fedocal.tests.test_week
+
+
+.. note:: In order to have coverage information you might have to install
+ ``python-coverage``
::
diff --git a/run_tests.sh b/run_tests.sh
index 101b71c..e5b8373 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-FEDOCAL_CONFIG=tests/fedocal_test.cfg PYTHONPATH=fedocal nosetests --with-coverage
--cover-package=fedocal
+FEDOCAL_CONFIG=tests/fedocal_test.cfg PYTHONPATH=fedocal nosetests --with-coverage
--cover-package=fedocal $*