Skip to content

Commit e854d05

Browse files
authored
Merge pull request #9550 from pytest-dev/backport-9545-to-7.0.x
2 parents b66899d + 48e64fe commit e854d05

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

doc/en/reference/reference.rst

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,39 @@ This page contains the full reference to pytest's API.
99
:depth: 3
1010
:local:
1111

12+
Constants
13+
---------
14+
15+
pytest.__version__
16+
~~~~~~~~~~~~~~~~~~
17+
18+
The current pytest version, as a string::
19+
20+
>>> import pytest
21+
>>> pytest.__version__
22+
'7.0.0'
23+
24+
25+
.. _`version-tuple`:
26+
27+
pytest.version_tuple
28+
~~~~~~~~~~~~~~~~~~~~
29+
30+
.. versionadded:: 7.0
31+
32+
The current pytest version, as a tuple::
33+
34+
>>> import pytest
35+
>>> pytest.version_tuple
36+
(7, 0, 0)
37+
38+
For pre-releases, the last component will be a string with the prerelease version::
39+
40+
>>> import pytest
41+
>>> pytest.version_tuple
42+
(7, 0, '0rc1')
43+
44+
1245
Functions
1346
---------
1447

@@ -226,37 +259,6 @@ Marks a test function as *expected to fail*.
226259
a new release of a library fixes a known bug).
227260

228261

229-
pytest.__version__
230-
~~~~~~~~~~~~~~~~~~
231-
232-
The current pytest version, as a string::
233-
234-
>>> import pytest
235-
>>> pytest.__version__
236-
'7.0.0'
237-
238-
239-
.. _`version-tuple`:
240-
241-
pytest.version_tuple
242-
~~~~~~~~~~~~~~~~~~~~
243-
244-
.. versionadded:: 7.0
245-
246-
The current pytest version, as a tuple::
247-
248-
>>> import pytest
249-
>>> pytest.version_tuple
250-
(7, 0, 0)
251-
252-
For pre-releases, the last component will be a string with the prerelease version::
253-
254-
>>> import pytest
255-
>>> pytest.version_tuple
256-
(7, 0, '0rc1')
257-
258-
259-
260262
Custom marks
261263
~~~~~~~~~~~~
262264

0 commit comments

Comments
 (0)