debian-django-filter/docs/dev/tests.txt

68 lines
1.4 KiB
Plaintext
Raw Normal View History

======================
Running the Test Suite
======================
2009-08-19 21:59:46 +02:00
The easiest way to run the django-filter tests is to check out the source
2016-11-08 17:16:08 +01:00
code and create a virtualenv where you can install the test dependencies.
Django-filter uses a custom test runner to configure the environment, so a
wrapper script is available to set up and run the test suite.
.. note::
The following assumes you have `virtualenv`__ and `git`__ installed.
2016-11-08 17:16:08 +01:00
__ https://virtualenv.pypa.io/en/stable/
__ https://git-scm.com
2016-11-08 17:16:08 +01:00
Clone the repository
--------------------
2016-11-08 17:16:08 +01:00
Get the source code using the following command:
2016-09-04 06:14:06 +02:00
.. code-block:: bash
2016-11-08 17:16:08 +01:00
$ git clone https://github.com/carltongibson/django-filter.git
2016-11-08 17:16:08 +01:00
Switch to the django-filter directory:
2016-09-04 06:14:06 +02:00
.. code-block:: bash
2016-11-08 17:16:08 +01:00
$ cd django-filter
2016-11-08 17:16:08 +01:00
Set up the virtualenv
---------------------
2016-11-08 17:16:08 +01:00
Create a new virtualenv to run the test suite in:
2016-09-04 06:14:06 +02:00
2016-11-08 17:16:08 +01:00
.. code-block:: bash
2016-11-08 17:16:08 +01:00
$ virtualenv venv
2016-11-08 17:16:08 +01:00
Then activate the virtualenv and install the test requirements:
2016-09-04 06:14:06 +02:00
.. code-block:: bash
2016-11-08 17:16:08 +01:00
$ source venv/bin/activate
$ pip install -r requirements/test.txt
2016-11-08 17:16:08 +01:00
Execute the test runner
-----------------------
Run the tests with the runner script:
2016-09-04 06:14:06 +02:00
.. code-block:: bash
2016-11-08 17:16:08 +01:00
$ python runtests.py
2015-07-18 21:47:20 +02:00
2016-11-08 17:16:08 +01:00
Test all supported versions
---------------------------
2015-07-18 21:47:20 +02:00
2016-11-08 17:16:08 +01:00
You can also use the excellent tox testing tool to run the tests against all
supported versions of Python and Django. Install tox, and then simply run:
2015-07-18 21:47:20 +02:00
2016-09-04 06:14:06 +02:00
.. code-block:: bash
2016-11-08 17:16:08 +01:00
$ pip install tox
$ tox