summaryrefslogtreecommitdiff
path: root/README.unittests.rst
blob: b84aa7a6f6d5b96f6dc38646456fac2173fb5af4 (plain)
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
32
33
34
Running Unit Tests
==================

Tests can be run be run using via py.test, nose, or the Python setup.py script::

	py.test

	nosetests -v

	python setup.py test

There's also a tox.ini file with several configurations::

	tox

Setting up Optional Databases
------------------------------

The test suite will attempt to run a subset of tests against various
database backends, including Postgresql and MySQL.   It uses the database
URLs in the file test.cfg to locate a URL for particular backend types.
If the URL cannot be loaded, either because the requisite DBAPI is
not present, or if the target database is found to be not accessible,
the test is skipped.

To run tests for these backends, replace URLs with working ones
inside the test.cfg file.   Setting a URL here requires that the
corresponding DBAPI is installed as well as that the target database
is running.  A connection to the database should provide access
to a *blank* schema, where tables will be created and dropped.  It
is critical that this schema have no tables in it already.

For Postgresql, it is also necessary that the target database contain
a user-accessible schema called "test_schema".