diff options
| author | Michael Merickel <michael@merickel.org> | 2021-01-15 13:31:48 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 13:31:48 -0600 |
| commit | 074f4f3eeec94b133293c0d1d0fa81d681b08e37 (patch) | |
| tree | 2c0b41982a2298592a180887a924b67fa16d65e0 /docs/quick_tour.rst | |
| parent | 837358ee6be552fd2f990d1ed8d6ea9e1c98d583 (diff) | |
| parent | b0dd658429367dd5e3cd99973bcc9a6763dcc5e7 (diff) | |
| download | pyramid-074f4f3eeec94b133293c0d1d0fa81d681b08e37.tar.gz pyramid-074f4f3eeec94b133293c0d1d0fa81d681b08e37.tar.bz2 pyramid-074f4f3eeec94b133293c0d1d0fa81d681b08e37.zip | |
Merge pull request #3648 from Pylons/prep-2.0-docs
More 2.0 docs prep
Diffstat (limited to 'docs/quick_tour.rst')
| -rw-r--r-- | docs/quick_tour.rst | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index c4ab0b3e8..be53a3344 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: @@ -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: /<somepath>/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: /<somepath>/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: @@ -755,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 |
