File: testing.rst

package info (click to toggle)
flask-restful 0.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 700 kB
  • ctags: 827
  • sloc: python: 3,743; makefile: 276; pascal: 26
file content (31 lines) | stat: -rw-r--r-- 908 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.. _testing:

Running the Tests
=================

A ``Makefile`` is included to take care of setting up a virtualenv for running tests. All you need to do is run::

    $ make test

To change the Python version used to run the tests (default is Python 2.7), change the ``PYTHON_MAJOR`` and ``PYTHON_MINOR`` variables at the top of the ``Makefile``.

You can run on all supported versions with::

    $ make test-all

Individual tests can be run using using a command with the format::

    nosetests <filename>:ClassName.func_name

Example::

    $ source env/bin/activate
    $ nosetests tests/test_reqparse.py:ReqParseTestCase.test_parse_choices_insensitive

Alternately, if you push changes to your fork on Github, Travis will run the tests
for your branch automatically.

A Tox config file is also provided so you can test against multiple python
versions locally (2.6, 2.7, 3.3, and 3.4) ::

    $ tox