Skip to content

Commit 4cab057

Browse files
committed
docs: fix broken markup in pytest.mark.django_db doc
1 parent 1c11e0e commit 4cab057

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

docs/helpers.rst

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@ Markers
2424
``pytest.mark.django_db`` - request database access
2525
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2626

27-
.. :py:function:: pytest.mark.django_db([transaction=False, reset_sequences=False]):
28-
29-
This is used to mark a test function as requiring the database. It
30-
will ensure the database is set up correctly for the test. Each test
31-
will run in its own transaction which will be rolled back at the end
32-
of the test. This behavior is the same as Django's standard
33-
:class:`~django.test.TestCase` class.
34-
35-
In order for a test to have access to the database it must either
36-
be marked using the ``django_db`` mark or request one of the ``db``,
37-
``transactional_db`` or ``django_db_reset_sequences`` fixtures. Otherwise the
38-
test will fail when trying to access the database.
39-
40-
:type transaction: bool
41-
:param transaction:
42-
The ``transaction`` argument will allow the test to use real transactions.
43-
With ``transaction=False`` (the default when not specified), transaction
44-
operations are noops during the test. This is the same behavior that
45-
:class:`django.test.TestCase` uses. When ``transaction=True``, the behavior
46-
will be the same as :class:`django.test.TransactionTestCase`.
47-
48-
49-
:type reset_sequences: bool
50-
:param reset_sequences:
51-
The ``reset_sequences`` argument will ask to reset auto increment sequence
52-
values (e.g. primary keys) before running the test. Defaults to
53-
``False``. Must be used together with ``transaction=True`` to have an
54-
effect. Please be aware that not all databases support this feature.
55-
For details see :py:attr:`django.test.TransactionTestCase.reset_sequences`.
27+
.. py:function:: pytest.mark.django_db([transaction=False, reset_sequences=False])
28+
29+
This is used to mark a test function as requiring the database. It
30+
will ensure the database is set up correctly for the test. Each test
31+
will run in its own transaction which will be rolled back at the end
32+
of the test. This behavior is the same as Django's standard
33+
:class:`~django.test.TestCase` class.
34+
35+
In order for a test to have access to the database it must either
36+
be marked using the ``django_db`` mark or request one of the ``db``,
37+
``transactional_db`` or ``django_db_reset_sequences`` fixtures. Otherwise the
38+
test will fail when trying to access the database.
39+
40+
:type transaction: bool
41+
:param transaction:
42+
The ``transaction`` argument will allow the test to use real transactions.
43+
With ``transaction=False`` (the default when not specified), transaction
44+
operations are noops during the test. This is the same behavior that
45+
:class:`django.test.TestCase` uses. When ``transaction=True``, the behavior
46+
will be the same as :class:`django.test.TransactionTestCase`.
47+
48+
49+
:type reset_sequences: bool
50+
:param reset_sequences:
51+
The ``reset_sequences`` argument will ask to reset auto increment sequence
52+
values (e.g. primary keys) before running the test. Defaults to
53+
``False``. Must be used together with ``transaction=True`` to have an
54+
effect. Please be aware that not all databases support this feature.
55+
For details see :py:attr:`django.test.TransactionTestCase.reset_sequences`.
5656

5757
.. note::
5858

0 commit comments

Comments
 (0)