Skip to content

Commit a637c31

Browse files
committed
Merge pull request pytest-dev#605 from blueyed/docs
Improve docs / qa
2 parents 8d548e7 + 7dbc63c commit a637c31

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727

2828
# pypy/pypy3: not included with coverage reports (much slower then).
2929
- python: pypy
30-
env: TOXENV=pypy-dj111-sqlite_file
30+
env: TOXENV=pypy-dj111-sqlite_file SKIP_COVERAGE=1
3131
- python: pypy3
32-
env: TOXENV=pypy3-dj110-sqlite
32+
env: TOXENV=pypy3-dj110-sqlite SKIP_COVERAGE=1
3333

3434
- python: 3.6
35-
env: TOXENV=checkqa
35+
env: TOXENV=checkqa,docs SKIP_COVERAGE=1
3636

3737
- stage: PyPI Release
3838
if: tag IS present
@@ -65,8 +65,8 @@ install:
6565

6666
- pip install tox==2.9.1
6767
- |
68-
# Setup coverage tracking, but not with "checkqa" nor "pypy*".
69-
if [[ "$TOXENV" != "checkqa" ]] && [[ "${TOXENV#pypy}" == "$TOXENV" ]]; then
68+
# Setup coverage tracking.
69+
if [[ "$SKIP_COVERAGE" != "1" ]]; then
7070
PYTEST_DJANGO_COVERAGE=1
7171
export PYTEST_ADDOPTS='--cov=pytest_django --cov=tests --cov=pytest_django_test --cov-report=term-missing:skip-covered'
7272
export _PYTESTDJANGO_TOX_EXTRA_DEPS=pytest-cov

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ $(VENV)/bin/pytest: $(VENV)/bin/python requirements.txt
1717
$(VENV)/bin/pip install -Ur requirements.txt
1818
touch $@
1919

20-
$(VENV)/bin/sphinx-build: $(VENV)/bin/pip
21-
$(VENV)/bin/pip install sphinx
22-
23-
docs: $(VENV)/bin/sphinx-build
24-
SPHINXBUILD=../$(VENV)/bin/sphinx-build $(MAKE) -C docs html
20+
docs:
21+
tox -e docs
2522

2623
# See setup.cfg for configuration.
2724
isort:

docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Compatibility
130130
database access was prevented on the cursor level. To be safer and prevent
131131
more cases, it is now prevented at the connection level. If you previously
132132
had tests which interacted with the databases without a database cursor, you
133-
will need to mark them with the :func:`pytest.mark.django_db` marker or
133+
will need to mark them with the ``pytest.mark.django_db`` marker or
134134
request the ``db`` fixture.
135135

136136
* The previously undocumented internal fixtures ``_django_db_setup``,

docs/database.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ django_db_blocker
246246

247247
.. warning::
248248
It does not manage transactions and changes made to the database will not
249-
be automatically restored. Using the :func:`pytest.mark.django_db` marker
249+
be automatically restored. Using the ``pytest.mark.django_db`` marker
250250
or :fixture:`db` fixture, which wraps database changes in a transaction and
251251
restores the state is generally the thing you want in tests. This marker
252252
can be used when you are trying to influence the way the database is

docs/helpers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ is configured to be in the containing Django project.
207207

208208
This fixture will ensure the Django database is set up. Only
209209
required for fixtures that want to use the database themselves. A
210-
test function should normally use the :py:func:`~pytest.mark.django_db`
210+
test function should normally use the ``pytest.mark.django_db``
211211
mark to signal it needs the database.
212212

213213
``transactional_db``
@@ -216,7 +216,7 @@ mark to signal it needs the database.
216216
This fixture can be used to request access to the database including
217217
transaction support. This is only required for fixtures which need
218218
database access themselves. A test function would normally use the
219-
:py:func:`~pytest.mark.django_db` mark to signal it needs the database.
219+
``pytest.mark.django_db`` mark to signal it needs the database.
220220

221221
``live_server``
222222
~~~~~~~~~~~~~~~

docs/managing_python_path.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ first file is found.
2525

2626
If you have a custom project setup, have none or multiple ``manage.py`` files
2727
in your project, the automatic detection may not be correct. See
28-
:ref:`managing_the_python_path_explicilty` for more details on how to configure
28+
:ref:`managing_the_python_path_explicitly` for more details on how to configure
2929
your environment in that case.
3030

3131
.. _managing_the_python_path_explicitly:

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ def read(fname):
3131
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
3232
setup_requires=['setuptools_scm>=1.11.1'],
3333
install_requires=['pytest>=3.6'],
34+
extras_require={
35+
'docs': [
36+
'sphinx',
37+
'Flask-Sphinx-Themes',
38+
]
39+
},
3440
classifiers=['Development Status :: 5 - Production/Stable',
3541
'Framework :: Django',
3642
'Framework :: Django :: 1.8',

tox.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ deps =
5959
commands =
6060
doc8 docs/
6161

62+
[testenv:docs]
63+
deps =
64+
extras = docs
65+
commands = sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
66+
6267
[testenv:readme]
6368
basepython = python3.5
6469
deps =

0 commit comments

Comments
 (0)