summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlan Smith <alan@randomsmiths.com>2018-09-08 21:10:10 -0400
committerAlan Smith <alan@randomsmiths.com>2018-09-08 21:10:10 -0400
commit0ee678a1b33abd6c64e88d36f3b4006b1b39ac04 (patch)
tree9f7b463bdfec234ad2de9354a623fc87fca9ae43 /docs
parent988893ed7bd906761e4b01438d371ad6d2577879 (diff)
downloadcherrypy-git-0ee678a1b33abd6c64e88d36f3b4006b1b39ac04.tar.gz
Made changes suggested in pull request comments
1) Changed from tut02 naming to tut12 2) Show commands with double backticks 3) Make source RST be same length under section title 4) Changed some spacing after periods to be single spaces.
Diffstat (limited to 'docs')
-rw-r--r--docs/tutorials.rst20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/tutorials.rst b/docs/tutorials.rst
index f8891f02..98101246 100644
--- a/docs/tutorials.rst
+++ b/docs/tutorials.rst
@@ -1202,7 +1202,7 @@ they work along with the CherryPy :ref:`engine <cpengine>`
and extend it with your operations.
Tutorial 12: Using pytest and code coverage
-###################################
+###########################################
Pytest
^^^^^^
@@ -1230,7 +1230,7 @@ Let's revisit :ref:`Tutorial 2 <tut02>`.
if __name__ == '__main__':
cherrypy.quickstart(StringGenerator())
-Save this into a file named `tut02.py`.
+Save this into a file named `tut12.py`.
Now make the test file:
@@ -1240,7 +1240,7 @@ Now make the test file:
import cherrypy
from cherrypy.test import helper
- from tut02 import StringGenerator
+ from tut12 import StringGenerator
class SimpleCPTest(helper.CPWebCase):
@staticmethod
@@ -1254,15 +1254,15 @@ Now make the test file:
self.getPage("/generate")
self.assertStatus('200 OK')
-Save this into a file named 'test_tut02.py' and run
+Save this into a file named 'test_tut12.py' and run
.. code-block:: bash
- $ pytest -v test_tut02.py
+ $ pytest -v test_tut12.py
.. note::
- If you don't have pytest installed, you'll need to install it by pip install pytest
+ If you don't have pytest installed, you'll need to install it by ``pip install pytest``
We now have a neat way that we can exercise our application making tests.
@@ -1273,14 +1273,14 @@ To get code coverage, simply run
.. code-block:: bash
- $ pytest --cov=tut02 --cov-report term-missing test_tut02.py
+ $ pytest --cov=tut12 --cov-report term-missing test_tut02.py
.. note::
- To add coverage support to pytest, you'll need to install it by pip install pytest-cov
+ To add coverage support to pytest, you'll need to install it by ``pip install pytest-cov``
-This tells us that one line is missing. Of course it is because that is only executed when
-the python program is started directly. We can simply change the following lines in tut02.py:
+This tells us that one line is missing. Of course it is because that is only executed when
+the python program is started directly. We can simply change the following lines in tut02.py:
.. code-block:: python
:lineno-start: 17