summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStemoser <8557058+stemoser@users.noreply.github.com>2019-08-16 16:48:34 +0200
committerStemoser <8557058+stemoser@users.noreply.github.com>2019-08-16 16:48:34 +0200
commit1538e4a2693a93bdc62d007248c626cfd8104d91 (patch)
treea32fe719c6e0d73ffe9609ef02d5bdda8c78ce49 /docs
parentdb0a8a685cf7c9650428c0fca407e17c3a3b8fde (diff)
downloadcherrypy-git-1538e4a2693a93bdc62d007248c626cfd8104d91.tar.gz
Docs: note on testing with interactive mode.
Diffstat (limited to 'docs')
-rw-r--r--docs/advanced.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/advanced.rst b/docs/advanced.rst
index 97a5892a..35f7684a 100644
--- a/docs/advanced.rst
+++ b/docs/advanced.rst
@@ -641,6 +641,26 @@ You can then run the test using `py.test <http://pytest.org/latest/>`_ as follow
$ py.test -s test_echo_app.py
The ``-s`` is necessary because the CherryPy class also wraps stdin and stdout.
+Without the flag, tests may hang on failed assertions waiting for an input.
+
+Another option to avoid this problem, (if, for example, you are running tests
+inside an IDE) is to disable the interactive mode that's enabled by default.
+It can be disabled setting the ``WEBTEST_INTERACTIVE`` environment variable to
+``False`` or ``0``.
+
+If you don't want to change environment variables to simply run a suite of tests
+you could also subclass the :class:`helper class <cherrypy.test.helper.CPWebCase>`,
+set ``helper.CPWebCase.interactive = False`` in the class and then derive all
+your test classes from your custom class:
+
+.. code-block:: python
+
+ import cherrypy
+ from cherrypy.test import helper
+
+ class TestsBase(helper.CPWebCase):
+
+ helper.CPWebCase.interactive = False
.. note::