Skip to content

Commit 77a995f

Browse files
authored
Add missing version added/changed markers to docs (#5966)
Add missing version added/changed markers to docs
2 parents 76c2a8e + 0383d43 commit 77a995f

File tree

7 files changed

+23
-2
lines changed

7 files changed

+23
-2
lines changed

doc/en/doctest.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ pytest also introduces new options:
156156
a string! This means that it may not be appropriate to enable globally in
157157
``doctest_optionflags`` in your configuration file.
158158

159+
.. versionadded:: 5.1
160+
159161

160162
Continue on failure
161163
-------------------

doc/en/fixture.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,13 @@ are finalized when the last test of a *package* finishes.
301301
Use this new feature sparingly and please make sure to report any issues you find.
302302

303303

304+
.. _dynamic scope:
305+
304306
Dynamic scope
305307
^^^^^^^^^^^^^
306308

309+
.. versionadded:: 5.2
310+
307311
In some cases, you might want to change the scope of the fixture without changing the code.
308312
To do that, pass a callable to ``scope``. The callable must return a string with a valid scope
309313
and will be executed only once - during the fixture definition. It will be called with two

doc/en/usage.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,11 @@ for example ``-x`` if you only want to send one particular failure.
718718
719719
Currently only pasting to the http://bpaste.net service is implemented.
720720

721+
.. versionchanged:: 5.2
722+
723+
If creating the URL fails for any reason, a warning is generated instead of failing the
724+
entire test suite.
725+
721726
Early loading plugins
722727
---------------------
723728

src/_pytest/config/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ class Config:
663663
class InvocationParams:
664664
"""Holds parameters passed during ``pytest.main()``
665665
666+
.. versionadded:: 5.1
667+
666668
.. note::
667669
668670
Currently the environment variable PYTEST_ADDOPTS is also handled by

src/_pytest/fixtures.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,9 +1088,13 @@ def fixture(
10881088
10891089
:arg scope: the scope for which this fixture is shared, one of
10901090
``"function"`` (default), ``"class"``, ``"module"``,
1091-
``"package"`` or ``"session"``.
1091+
``"package"`` or ``"session"`` (``"package"`` is considered **experimental**
1092+
at this time).
10921093
1093-
``"package"`` is considered **experimental** at this time.
1094+
This parameter may also be a callable which receives ``(fixture_name, config)``
1095+
as parameters, and must return a ``str`` with one of the values mentioned above.
1096+
1097+
See :ref:`dynamic scope` in the docs for more information.
10941098
10951099
:arg params: an optional list of parameters which will cause multiple
10961100
invocations of the fixture function and all of the tests

src/_pytest/hookspec.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@ def pytest_assertion_pass(item, lineno, orig, expl):
488488
"""
489489
**(Experimental)**
490490
491+
.. versionadded:: 5.0
492+
491493
Hook called whenever an assertion *passes*.
492494
493495
Use this hook to do some processing after a passing assertion.

src/_pytest/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
class ExitCode(enum.IntEnum):
2222
"""
23+
.. versionadded:: 5.0
24+
2325
Encodes the valid exit codes by pytest.
2426
2527
Currently users and plugins may supply other exit codes as well.

0 commit comments

Comments
 (0)