From aecbaaed0c1a0d7da99a8d3deb9328ad2b5c601d Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 1 Jul 2013 13:58:04 -0400 Subject: [PATCH] [1.6.x] Fixed #19196 -- Added test/requirements Backport of 4d92a0bd86 from master. --- .../contributing/writing-code/unit-tests.txt | 19 ++++++++++++++++++- tests/requirements/base.txt | 6 ++++++ tests/requirements/mysql.txt | 1 + tests/requirements/oracle.txt | 1 + tests/requirements/postgres.txt | 1 + tests/requirements/py2.txt | 2 ++ tests/requirements/py3.txt | 2 ++ tests/runtests.py | 1 + 8 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/requirements/base.txt create mode 100644 tests/requirements/mysql.txt create mode 100644 tests/requirements/oracle.txt create mode 100644 tests/requirements/postgres.txt create mode 100644 tests/requirements/py2.txt create mode 100644 tests/requirements/py3.txt diff --git a/docs/internals/contributing/writing-code/unit-tests.txt b/docs/internals/contributing/writing-code/unit-tests.txt index 0737b848888..f47ac5e788f 100644 --- a/docs/internals/contributing/writing-code/unit-tests.txt +++ b/docs/internals/contributing/writing-code/unit-tests.txt @@ -136,23 +136,40 @@ Running all the tests If you want to run the full suite of tests, you'll need to install a number of dependencies: +* Pillow_ * PyYAML_ +* pytz_ * setuptools_ * memcached_, plus a :ref:`supported Python binding ` * gettext_ (:ref:`gettext_on_windows`) -* selenium_ (if also using Python >= 2.6) +* selenium_ + +You can find these dependencies in `pip requirements files`_ inside the +``tests/requirements`` directory of the Django source tree and install them +like so:: + + pip install -r tests/requirements/py2.txt # Python 3: py3.txt + +You can also install the database adapter(s) of your choice using +``oracle.txt``, ``mysql.txt``, or ``postgres.txt``. If you want to test the memcached cache backend, you'll also need to define a :setting:`CACHES` setting that points at your memcached instance. +To run the GeoDjango tests, you will need to :doc:`setup a spatial database +and install the Geospatial libraries`. + Each of these dependencies is optional. If you're missing any of them, the associated tests will be skipped. +.. _Pillow: https://pypi.python.org/pypi/Pillow/ .. _PyYAML: http://pyyaml.org/wiki/PyYAML +.. _pytz: https://pypi.python.org/pypi/pytz/ .. _setuptools: http://pypi.python.org/pypi/setuptools/ .. _memcached: http://memcached.org/ .. _gettext: http://www.gnu.org/software/gettext/manual/gettext.html .. _selenium: http://pypi.python.org/pypi/selenium +.. _pip requirements files: http://www.pip-installer.org/en/latest/requirements.html Code coverage ~~~~~~~~~~~~~ diff --git a/tests/requirements/base.txt b/tests/requirements/base.txt new file mode 100644 index 00000000000..89bd8230b29 --- /dev/null +++ b/tests/requirements/base.txt @@ -0,0 +1,6 @@ +bcrypt +docutils +Pillow +PyYAML +pytz +selenium diff --git a/tests/requirements/mysql.txt b/tests/requirements/mysql.txt new file mode 100644 index 00000000000..c7a23474071 --- /dev/null +++ b/tests/requirements/mysql.txt @@ -0,0 +1 @@ +MySQL-python diff --git a/tests/requirements/oracle.txt b/tests/requirements/oracle.txt new file mode 100644 index 00000000000..ae5b7349cde --- /dev/null +++ b/tests/requirements/oracle.txt @@ -0,0 +1 @@ +cx_oracle diff --git a/tests/requirements/postgres.txt b/tests/requirements/postgres.txt new file mode 100644 index 00000000000..658130bb2c0 --- /dev/null +++ b/tests/requirements/postgres.txt @@ -0,0 +1 @@ +psycopg2 diff --git a/tests/requirements/py2.txt b/tests/requirements/py2.txt new file mode 100644 index 00000000000..a9f68040391 --- /dev/null +++ b/tests/requirements/py2.txt @@ -0,0 +1,2 @@ +-r base.txt +python-memcached diff --git a/tests/requirements/py3.txt b/tests/requirements/py3.txt new file mode 100644 index 00000000000..ced3eed1017 --- /dev/null +++ b/tests/requirements/py3.txt @@ -0,0 +1,2 @@ +-r base.txt +python3-memcached diff --git a/tests/runtests.py b/tests/runtests.py index da4592ecc08..0d8df30bf7b 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -22,6 +22,7 @@ TEMP_DIR = tempfile.mkdtemp(prefix='django_') os.environ['DJANGO_TEST_TEMP_DIR'] = TEMP_DIR SUBDIRS_TO_SKIP = [ + 'requirements', 'templates', 'test_discovery_sample', 'test_discovery_sample2',