| | |
| | | .. literalinclude:: unit_testing/setup.py |
| | | :language: python |
| | | :linenos: |
| | | :emphasize-lines: 11-15 |
| | | :emphasize-lines: 15 |
| | | |
| | | #. Install our project and its newly added dependency. |
| | | Note that we use the extra specifier ``[test]`` to install testing requirements. |
| | | Note that we use the extra specifier ``[dev]`` to install testing requirements for development and surround it and the period with double quote marks. |
| | | |
| | | .. code-block:: bash |
| | | |
| | | $VENV/bin/pip install -e .[test] |
| | | $VENV/bin/pip install -e ".[dev]" |
| | | |
| | | #. Now we write a simple unit test in ``unit_testing/tutorial/tests.py``: |
| | | |
| | |
| | | ``pyramid.testing.tearDown()`` aren't actually necessary here; they are only |
| | | necessary when your test needs to make use of the ``config`` object (it's a |
| | | Configurator) to add stuff to the configuration state before calling the view. |
| | | |
| | | Finally we've introduced the concept of :term:`Setuptools` extras. |
| | | These are optional or recommended features that may be installed with an "extras" specifier. |
| | | The specifier is the name of a key in a Python dictionary, and is surrounded by square brackets when invoked on the command line. |
| | | The value for the key is a Python list of dependencies. |
| | | |
| | | |
| | | Extra credit |