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.rst61
1 files changed, 32 insertions, 29 deletions
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index e0f0be1f3..fc5cfd056 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -266,7 +266,8 @@ Here's sample output from a test run on Unix:
....
4 passed in 0.45 seconds
-The tests themselves are found in the ``tests.py`` module in your ``cookiecutter``-generated project. Within this project generated by the ``pyramid-cookiecutter-starter`` cookiecutter, only a few sample tests exist.
+The tests themselves are found in the ``test_it.py`` module 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::
@@ -288,7 +289,7 @@ path to the module on which we want to run tests and coverage.
.. code-block:: bash
- $VENV/bin/pytest --cov=myproject myproject/tests.py -q
+ $VENV/bin/pytest --cov=myproject myproject tests -q
.. seealso:: See ``pytest``'s documentation for :ref:`pytest:usage` or invoke
``pytest -h`` to see its full set of options.
@@ -535,6 +536,8 @@ The ``myproject`` project we've generated has the following directory structure:
├── .gitignore
├── CHANGES.txt
├── MANIFEST.in
+ ├── README.txt
+ ├── development.ini
├── myproject
│   ├── __init__.py
│   ├── routes.py
@@ -546,16 +549,37 @@ The ``myproject`` project we've generated has the following directory structure:
│   │   ├── 404.jinja2
│   │   ├── layout.jinja2
│   │   └── mytemplate.jinja2
- │   ├── tests.py
│   └── views
│   ├── __init__.py
│   ├── default.py
│   └── notfound.py
- ├── README.txt
- ├── development.ini
├── production.ini
├── pytest.ini
- └── setup.py
+ ├── setup.py
+ └── tests
+ ├── __init__.py
+ └── test_it.py
+
+
+.. index::
+ single: tests
+
+``test_it.py``
+~~~~~~~~~~~~~~
+
+The ``test_it.py`` module in the ``tests`` package includes tests for your application.
+
+.. literalinclude:: myproject/tests/test_it.py
+ :language: python
+ :linenos:
+
+This sample ``test_it.py`` file has two unit tests and two functional 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.
+
+See :ref:`testing_chapter` for more information about writing :app:`Pyramid` unit tests.
The ``myproject`` :term:`Project`
@@ -591,6 +615,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.
+#. ``tests`` package which contains unit and functional test code for the application.
+
.. index::
single: PasteDeploy
single: ini file
@@ -819,8 +845,6 @@ The ``myproject`` :term:`package` lives inside the ``myproject``
#. A ``templates`` directory, which contains :term:`Jinja2` (or other types
of) templates.
-#. A ``tests.py`` module, which contains unit and functional test code for the application.
-
#. A ``routes.py`` module, which contains routing code for the application.
#. A ``views`` package, which contains view code for the application.
@@ -1041,27 +1065,6 @@ It inherits the HTML provided by ``layout.jinja2``, replacing the content block
.. index::
- single: tests.py
-
-``tests.py``
-~~~~~~~~~~~~
-
-The ``tests.py`` module includes tests for your application.
-
-.. literalinclude:: myproject/myproject/tests.py
- :language: python
- :linenos:
-
-This sample ``tests.py`` file has two unit tests and two functional 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.
-
-See :ref:`testing_chapter` for more information about writing :app:`Pyramid`
-unit tests.
-
-.. index::
pair: modifying; package structure
.. _modifying_package_structure: