diff options
| author | Steve Piercy <web@stevepiercy.com> | 2018-10-07 03:48:18 -0700 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2018-10-07 04:26:35 -0700 |
| commit | 8998f6fbaf526c0c0fe4300ec78815c7badfa826 (patch) | |
| tree | bb7c1630855c047ae89c5855ff5c9b8e8781e851 | |
| parent | 34a7a85436e1545356345affc21dd1a564635469 (diff) | |
| download | pyramid-8998f6fbaf526c0c0fe4300ec78815c7badfa826.tar.gz pyramid-8998f6fbaf526c0c0fe4300ec78815c7badfa826.tar.bz2 pyramid-8998f6fbaf526c0c0fe4300ec78815c7badfa826.zip | |
Make webtest an extra dependency in setup.py.
Carry forward previous setup.py changes.
| -rw-r--r-- | docs/quick_tutorial/functional_testing.rst | 43 | ||||
| -rw-r--r-- | docs/quick_tutorial/functional_testing/setup.py | 9 |
2 files changed, 34 insertions, 18 deletions
diff --git a/docs/quick_tutorial/functional_testing.rst b/docs/quick_tutorial/functional_testing.rst index 7c4dcee26..d3ada3793 100644 --- a/docs/quick_tutorial/functional_testing.rst +++ b/docs/quick_tutorial/functional_testing.rst @@ -31,31 +31,40 @@ Objectives Steps ===== -#. First we copy the results of the previous step, as well as install the - ``webtest`` package: +#. First we copy the results of the previous step. - .. code-block:: bash + .. code-block:: bash - cd ..; cp -r unit_testing functional_testing; cd functional_testing - $VENV/bin/pip install -e . - $VENV/bin/pip install webtest + cd ..; cp -r unit_testing functional_testing; cd functional_testing -#. Let's extend ``functional_testing/tutorial/tests.py`` to include a - functional test: +#. Add ``webtest`` to our project's dependencies in ``setup.py`` as a :term:`Setuptools` "extra": - .. literalinclude:: functional_testing/tutorial/tests.py - :linenos: + .. literalinclude:: functional_testing/setup.py + :language: python + :linenos: + :emphasize-lines: 14 - Be sure this file is not executable, or ``pytest`` may not include your - tests. +#. Install our project and its newly added dependency. + Note that we use the extra specifier ``[test]`` to install testing requirements. + + .. code-block:: bash + + $VENV/bin/pip install -e .[test] + +#. Let's extend ``functional_testing/tutorial/tests.py`` to include a functional test: + + .. literalinclude:: functional_testing/tutorial/tests.py + :linenos: + + Be sure this file is not executable, or ``pytest`` may not include your tests. -#. Now run the tests: +#. Now run the tests: - .. code-block:: bash + .. code-block:: bash - $VENV/bin/pytest tutorial/tests.py -q - .. - 2 passed in 0.25 seconds + $VENV/bin/pytest tutorial/tests.py -q + .. + 2 passed in 0.25 seconds Analysis diff --git a/docs/quick_tutorial/functional_testing/setup.py b/docs/quick_tutorial/functional_testing/setup.py index a93cf6a73..c0d3dee8f 100644 --- a/docs/quick_tutorial/functional_testing/setup.py +++ b/docs/quick_tutorial/functional_testing/setup.py @@ -2,13 +2,20 @@ from setuptools import setup requires = [ 'pyramid', + 'pyramid_debugtoolbar', 'waitress', ] setup(name='tutorial', install_requires=requires, + extras_require={ + 'test': [ + 'pytest', + 'webtest', + ], + }, entry_points="""\ [paste.app_factory] main = tutorial:main """, -)
\ No newline at end of file + ) |
