summaryrefslogtreecommitdiff
path: root/docs/narr/project.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/narr/project.rst')
-rw-r--r--docs/narr/project.rst47
1 files changed, 37 insertions, 10 deletions
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index 043f77754..6493f0fe7 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -210,9 +210,9 @@ Elided output from a run of this command on Unix is shown below:
Running setup.py develop for myproject
Successfully installed Jinja2-2.10.3 Mako-1.1.0 MarkupSafe-1.1.1 \
PasteDeploy-2.0.1 Pygments-2.5.2 hupper-1.9.1 myproject plaster-1.0 \
- plaster-pastedeploy-0.7 pyramid-1.10.4 pyramid-debugtoolbar-4.5.1 \
+ plaster-pastedeploy-0.7 pyramid-1.10.4 pyramid-debugtoolbar-4.5.2 \
pyramid-jinja2-2.8 pyramid-mako-1.1.0 repoze.lru-0.7 \
- translationstring-1.3 venusian-3.0.0 waitress-1.4.1 webob-1.8.5 \
+ translationstring-1.3 venusian-3.0.0 waitress-1.4.2 webob-1.8.5 \
zope.deprecation-4.4.0 zope.interface-4.7.1
This will install a :term:`distribution` representing your project into the
@@ -264,9 +264,9 @@ Here's sample output from a test run on Unix:
$VENV/bin/pytest -q
....
- 4 passed in 0.45 seconds
+ 4 passed in 0.31s
-The tests themselves are found in the ``test_it.py`` module in the ``tests`` package in your ``cookiecutter``-generated project.
+The tests themselves are found in the ``tests`` package in your ``cookiecutter``-generated project.
Within this project generated by the ``pyramid-cookiecutter-starter`` cookiecutter, only a few sample tests exist.
.. note::
@@ -555,10 +555,12 @@ The ``myproject`` project we've generated has the following directory structure:
│   └── notfound.py
├── production.ini
├── pytest.ini
- ├── setup.py
+ ├── testing.ini
└── tests
├── __init__.py
- └── test_it.py
+ ├── conftest.py
+ ├── test_functional.py
+ └── test_views.py
.. index::
@@ -567,17 +569,27 @@ The ``myproject`` project we've generated has the following directory structure:
``test_it.py``
~~~~~~~~~~~~~~
-The ``test_it.py`` module in the ``tests`` package includes tests for your application.
+The ``conftest.py``, ``test_functional.py``, and ``test_views.py`` modules in the ``tests`` package includes tests for your application.
-.. literalinclude:: myproject/tests/test_it.py
+.. literalinclude:: myproject/tests/conftest.py
:language: python
:linenos:
-This sample ``test_it.py`` file has two unit tests and two functional tests defined within it.
+.. literalinclude:: myproject/tests/test_functional.py
+ :language: python
+ :linenos:
+
+.. literalinclude:: myproject/tests/test_views.py
+ :language: python
+ :linenos:
+
+The sample ``conftest.py`` file contains test configuration and fixtures.
+The sample ``test_functional.py`` file has two functional tests defined within it.
+The sample ``test_views.py`` file has two unit tests defined within it.
These tests are executed when you run ``pytest -q``.
You may add more tests here as you build your application.
You are not required to write tests to use :app:`Pyramid`.
-This file is simply provided for convenience and example.
+These files are provided only for convenience and example.
See :ref:`testing_chapter` for more information about writing :app:`Pyramid` unit tests.
@@ -615,6 +627,8 @@ describe, run, and test your application.
#. ``setup.py`` is the file you'll use to test and distribute your application.
It is a standard :term:`Setuptools` ``setup.py`` file.
+#. ``testing.ini`` is a :term:`PasteDeploy` configuration file that can be used to execute your application's tests.
+
#. ``tests`` package which contains unit and functional test code for the application.
.. index::
@@ -717,6 +731,19 @@ inclusion of this toolbar slows down page rendering times by over an order of
magnitude. The debug toolbar is also a potential security risk if you have it
configured incorrectly.
+
+.. index::
+ single: testing.ini
+
+``testing.ini``
+~~~~~~~~~~~~~~~
+
+The ``testing.ini`` file is a :term:`PasteDeploy` configuration file with a purpose much like that of ``development.ini``.
+It is similar to ``development.ini``, but is optimized to reduce test execution time.
+It disables the debug toolbar and automatic reloading of templates, as these slow down test execution.
+This file is appropriate to use instead of ``development.ini`` when you run your application's tests.
+
+
.. index::
single: MANIFEST.in