@@ -11,27 +11,27 @@ for testing `Django`_ applications and projects.
11
11
Quick Start
12
12
===========
13
13
14
- 1. ``pip install pytest-django ``
15
- 2. Make sure ``DJANGO_SETTINGS_MODULE `` is defined and and run tests with the ``pytest `` command.
16
- 3. (Optional) If you want tests of Django's default application layout be discovered (``tests.py ``),
17
- if you put your tests under a ``tests/ `` directory , or your files are not named ``test_FOO.py ``,
18
- see the FAQ at :ref: `faq-tests-not-being-picked-up `.
14
+ .. code-block :: bash
19
15
20
- Table of Contents
21
- =================
16
+ $ pip install pytest-django
22
17
23
- .. toctree ::
24
- :maxdepth: 3
18
+ Make sure ``DJANGO_SETTINGS_MODULE `` is defined (see
19
+ :ref: `configuring_django_settings `) and make your tests discoverable
20
+ (see :ref: `faq-tests-not-being-picked-up `):
25
21
26
- tutorial
27
- configuring_django
28
- managing_python_path
29
- usage
30
- database
31
- helpers
32
- faq
33
- contributing
34
- changelog
22
+ .. code-block :: ini
23
+
24
+ # -- FILE: pytest.ini (or tox.ini)
25
+ [pytest]
26
+ DJANGO_SETTINGS_MODULE = test_settings
27
+ # -- recommended but optional:
28
+ python_files = tests.py test_*.py *_tests.py
29
+
30
+ Run your tests with ``pytest ``:
31
+
32
+ .. code-block :: bash
33
+
34
+ $ pytest
35
35
36
36
Why would I use this instead of Django's manage.py test command?
37
37
================================================================
@@ -50,14 +50,30 @@ See the `pytest documentation`_ for more information on pytest.
50
50
.. _Manage test dependencies with fixtures : http://docs.pytest.org/en/latest/fixture.html
51
51
.. _pytest documentation : http://docs.pytest.org/
52
52
53
- Bugs? Feature suggestions ?
53
+ Bugs? Feature Suggestions ?
54
54
==========================
55
55
56
56
Report issues and feature requests at the `GitHub issue tracker `_.
57
57
58
58
.. _GitHub issue tracker : http://github.com/pytest-dev/pytest-django/issues
59
59
60
- Indices and tables
60
+ Table of Contents
61
+ =================
62
+
63
+ .. toctree ::
64
+ :maxdepth: 3
65
+
66
+ tutorial
67
+ configuring_django
68
+ managing_python_path
69
+ usage
70
+ database
71
+ helpers
72
+ faq
73
+ contributing
74
+ changelog
75
+
76
+ Indices and Tables
61
77
==================
62
78
63
79
* :ref: `genindex `
0 commit comments