Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs per https://github.com/Pylons/pyramid/commit/fb7a98bbdace… #2899

Merged
merged 1 commit into from
Jan 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions docs/tutorials/wiki2/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,36 @@ so on.
View the results of all our edits to ``tests`` subpackage
=========================================================

Open ``tutorial/tests/test_views.py``, and edit it such that it appears as
follows:
Create ``tutorial/tests/test_views.py`` such that it appears as follows:

.. literalinclude:: src/tests/tutorial/tests/test_views.py
:linenos:
:language: python

Open ``tutorial/tests/test_functional.py``, and edit it such that it appears as
follows:
Create ``tutorial/tests/test_functional.py`` such that it appears as follows:

.. literalinclude:: src/tests/tutorial/tests/test_functional.py
:linenos:
:language: python

Create ``tutorial/tests/test_initdb.py`` such that it appears as follows:

.. literalinclude:: src/tests/tutorial/tests/test_initdb.py
:linenos:
:language: python

Create ``tutorial/tests/test_security.py`` such that it appears as follows:

.. literalinclude:: src/tests/tutorial/tests/test_security.py
:linenos:
:language: python

Create ``tutorial/tests/test_user_model.py`` such that it appears as follows:

.. literalinclude:: src/tests/tutorial/tests/test_user_model.py
:linenos:
:language: python


.. note::

Expand All @@ -77,32 +93,27 @@ follows:
Running the tests
=================

We can run these tests similarly to how we did in :ref:`running_tests`:
We can run these tests similarly to how we did in :ref:`running_tests`, but first delete the SQLite database ``tutorial.sqlite``. If you do not delete the database, then you will see an integrity error when running the tests.

On UNIX:

.. code-block:: bash

$ rm tutorial.sqlite
$ $VENV/bin/py.test -q

On Windows:

.. code-block:: doscon

c:\tutorial> del tutorial.sqlite
c:\tutorial> %VENV%\Scripts\py.test -q

The expected result should look like the following:

.. code-block:: text

......................
22 passed, 1 pytest-warnings in 5.81 seconds

.. note:: If you use Python 3 during this tutorial, you will see deprecation
warnings in the output, which we will choose to ignore. In making this
tutorial run on both Python 2 and 3, the authors prioritized simplicity and
focus for the learner over accommodating warnings. In your own app or as
extra credit, you may choose to either drop Python 2 support or hack your
code to work without warnings on both Python 2 and 3.
................................
32 passed in 9.90 seconds

.. _webtest: http://docs.pylonsproject.org/projects/webtest/en/latest/