From ab8b801d5ac13feac86219ad8860f0426140d0de Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Jan 2021 07:55:02 -0800 Subject: Update Quick Tutorial and Quick Tour cookiecutter steps --- docs/quick_tour.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tour.rst') diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index c4ab0b3e8..9f771bc56 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -682,7 +682,7 @@ Yikes! We got this far and we haven't yet discussed tests. This is particularly egregious, as Pyramid has had a deep commitment to full test coverage since before its release. -Our ``pyramid-cookiecutter-starter`` cookiecutter generated a ``test_it.py`` module inside the ``tests`` package with two unit tests and two functional tests in it. +Our ``pyramid-cookiecutter-starter`` cookiecutter generated ``conftest.py``, ``test_functional.py``, and ``test_views.py`` modules inside the ``tests`` package with two unit tests and two functional tests in it. It also configured ``setup.py`` with test requirements: ``pytest`` as the test runner, ``WebTest`` for running view tests, and the ``pytest-cov`` tool which yells at us for code that isn't tested: -- cgit v1.2.3 From 4d5d68db549c2ed297ba83679cf7ceb5169eaab3 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Jan 2021 08:00:50 -0800 Subject: Update Quick Tour Testing step --- docs/quick_tour.rst | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'docs/quick_tour.rst') diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index 9f771bc56..4b0516c97 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -708,29 +708,34 @@ This yields the following output. .. code-block:: text =========================== test session starts =========================== - platform darwin -- Python 3.7.3, pytest-5.3.2, py-1.8.1, pluggy-0.13.1 - rootdir: //hello_world, inifile: pytest.ini, testpaths: hello_world, tests - plugins: cov-2.8.1 + platform darwin -- Python 3.9.0, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 + rootdir: //hello_world, configfile: pytest.ini, testpaths: hello_world, tests + plugins: cov-2.10.1 collected 4 items - tests/test_it.py .... [100%] + tests/test_functional.py .. [ 50%] + tests/test_views.py .. [100%] - ---------- coverage: platform darwin, python 3.7.3-final-0 ----------- + ---------- coverage: platform darwin, python 3.9.0-final-0 ----------- Name Stmts Miss Cover Missing ------------------------------------------------------------- hello_world/__init__.py 7 0 100% hello_world/routes.py 3 0 100% hello_world/views/__init__.py 0 0 100% - hello_world/views/default.py 3 0 100% - hello_world/views/notfound.py 4 0 100% + hello_world/views/default.py 4 0 100% + hello_world/views/notfound.py 5 0 100% ------------------------------------------------------------- - TOTAL 17 0 100% + TOTAL 19 0 100% ======================== 4 passed in 0.65 seconds ========================= -Our tests passed, and its coverage is complete. What did our test look like? +Our tests passed, and its coverage is complete. What did our tests look like? -.. literalinclude:: quick_tour/package/tests/test_it.py +.. literalinclude:: quick_tour/package/tests/test_functional.py + :language: python + :linenos: + +.. literalinclude:: quick_tour/package/tests/test_views.py :language: python :linenos: -- cgit v1.2.3 From 6326c7ca69a5ee53a27f36ce7eec4784efaef345 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Jan 2021 08:05:34 -0800 Subject: Update logging and sessions steps in Quick Tour --- docs/quick_tour.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tour.rst') diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index 4b0516c97..be53a3344 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -760,7 +760,7 @@ logging for you to some reasonable defaults. You then see messages sent by Pyramid (for example, when a new request comes in). Maybe you would like to log messages in your code? In your Python module, -import and set up the logging in your ``views.py``: +import and set up the logging in your ``views/default.py``: .. literalinclude:: quick_tour/logging/hello_world/views/default.py :language: python -- cgit v1.2.3