Merge pull request #10259 from pytest-dev/release-7.1.3
Prepare release 7.1.3 (cherry picked from commit 3739e6cd4830cf707dff3fb5c5b93d7a2cec3663)
This commit is contained in:
parent
245a8c23dd
commit
7f4b63b143
|
@ -1 +0,0 @@
|
||||||
When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``.
|
|
|
@ -1 +0,0 @@
|
||||||
Replace `atomicwrites <https://github.com/untitaker/python-atomicwrites>`__ dependency on windows with `os.replace`.
|
|
|
@ -1 +0,0 @@
|
||||||
Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports.
|
|
|
@ -1 +0,0 @@
|
||||||
Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 <https://pip.pypa.io/en/stable/news/#v21-3>`__.
|
|
|
@ -1 +0,0 @@
|
||||||
Doctests now respect the ``--import-mode`` flag.
|
|
|
@ -1 +0,0 @@
|
||||||
Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed string representation for :func:`pytest.approx` when used to compare tuples.
|
|
|
@ -1 +0,0 @@
|
||||||
Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`.
|
|
|
@ -6,6 +6,7 @@ Release announcements
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
|
|
||||||
|
release-7.1.3
|
||||||
release-7.1.2
|
release-7.1.2
|
||||||
release-7.1.1
|
release-7.1.1
|
||||||
release-7.1.0
|
release-7.1.0
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
pytest-7.1.3
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 7.1.3 has just been released to PyPI.
|
||||||
|
|
||||||
|
This is a bug-fix release, being a drop-in replacement. To upgrade::
|
||||||
|
|
||||||
|
pip install --upgrade pytest
|
||||||
|
|
||||||
|
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Anthony Sottile
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Gergely Kalmár
|
||||||
|
* Nipunn Koorapati
|
||||||
|
* Pax
|
||||||
|
* Sviatoslav Sydorenko
|
||||||
|
* Tim Hoffmann
|
||||||
|
* Tony Narlock
|
||||||
|
* Wolfremium
|
||||||
|
* Zach OBrien
|
||||||
|
* aizpurua23a
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -40,32 +40,86 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
calls, which return a ``(out, err)`` namedtuple.
|
calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``text`` objects.
|
``out`` and ``err`` will be ``text`` objects.
|
||||||
|
|
||||||
capsysbinary -- .../_pytest/capture.py:895
|
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_output(capsys):
|
||||||
|
print("hello")
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert captured.out == "hello\n"
|
||||||
|
|
||||||
|
capsysbinary -- .../_pytest/capture.py:906
|
||||||
Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.
|
Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.
|
||||||
|
|
||||||
The captured output is made available via ``capsysbinary.readouterr()``
|
The captured output is made available via ``capsysbinary.readouterr()``
|
||||||
method calls, which return a ``(out, err)`` namedtuple.
|
method calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``bytes`` objects.
|
``out`` and ``err`` will be ``bytes`` objects.
|
||||||
|
|
||||||
capfd -- .../_pytest/capture.py:912
|
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_output(capsysbinary):
|
||||||
|
print("hello")
|
||||||
|
captured = capsysbinary.readouterr()
|
||||||
|
assert captured.out == b"hello\n"
|
||||||
|
|
||||||
|
capfd -- .../_pytest/capture.py:934
|
||||||
Enable text capturing of writes to file descriptors ``1`` and ``2``.
|
Enable text capturing of writes to file descriptors ``1`` and ``2``.
|
||||||
|
|
||||||
The captured output is made available via ``capfd.readouterr()`` method
|
The captured output is made available via ``capfd.readouterr()`` method
|
||||||
calls, which return a ``(out, err)`` namedtuple.
|
calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``text`` objects.
|
``out`` and ``err`` will be ``text`` objects.
|
||||||
|
|
||||||
capfdbinary -- .../_pytest/capture.py:929
|
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_system_echo(capfd):
|
||||||
|
os.system('echo "hello"')
|
||||||
|
captured = capfd.readouterr()
|
||||||
|
assert captured.out == "hello\n"
|
||||||
|
|
||||||
|
capfdbinary -- .../_pytest/capture.py:962
|
||||||
Enable bytes capturing of writes to file descriptors ``1`` and ``2``.
|
Enable bytes capturing of writes to file descriptors ``1`` and ``2``.
|
||||||
|
|
||||||
The captured output is made available via ``capfd.readouterr()`` method
|
The captured output is made available via ``capfd.readouterr()`` method
|
||||||
calls, which return a ``(out, err)`` namedtuple.
|
calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``byte`` objects.
|
``out`` and ``err`` will be ``byte`` objects.
|
||||||
|
|
||||||
doctest_namespace [session scope] -- .../_pytest/doctest.py:731
|
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_system_echo(capfdbinary):
|
||||||
|
os.system('echo "hello"')
|
||||||
|
captured = capfdbinary.readouterr()
|
||||||
|
assert captured.out == b"hello\n"
|
||||||
|
|
||||||
|
doctest_namespace [session scope] -- .../_pytest/doctest.py:735
|
||||||
Fixture that returns a :py:class:`dict` that will be injected into the
|
Fixture that returns a :py:class:`dict` that will be injected into the
|
||||||
namespace of doctests.
|
namespace of doctests.
|
||||||
|
|
||||||
pytestconfig [session scope] -- .../_pytest/fixtures.py:1334
|
Usually this fixture is used in conjunction with another ``autouse`` fixture:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def add_np(doctest_namespace):
|
||||||
|
doctest_namespace["np"] = numpy
|
||||||
|
|
||||||
|
For more details: :ref:`doctest_namespace`.
|
||||||
|
|
||||||
|
pytestconfig [session scope] -- .../_pytest/fixtures.py:1344
|
||||||
Session-scoped fixture that returns the session's :class:`pytest.Config`
|
Session-scoped fixture that returns the session's :class:`pytest.Config`
|
||||||
object.
|
object.
|
||||||
|
|
||||||
|
@ -117,10 +171,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
`pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See
|
`pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See
|
||||||
:issue:`7767` for details.
|
:issue:`7767` for details.
|
||||||
|
|
||||||
tmpdir_factory [session scope] -- .../_pytest/legacypath.py:295
|
tmpdir_factory [session scope] -- .../_pytest/legacypath.py:302
|
||||||
Return a :class:`pytest.TempdirFactory` instance for the test session.
|
Return a :class:`pytest.TempdirFactory` instance for the test session.
|
||||||
|
|
||||||
tmpdir -- .../_pytest/legacypath.py:302
|
tmpdir -- .../_pytest/legacypath.py:309
|
||||||
Return a temporary directory path object which is unique to each test
|
Return a temporary directory path object which is unique to each test
|
||||||
function invocation, created as a sub directory of the base temporary
|
function invocation, created as a sub directory of the base temporary
|
||||||
directory.
|
directory.
|
||||||
|
@ -132,6 +186,11 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
|
|
||||||
The returned object is a `legacy_path`_ object.
|
The returned object is a `legacy_path`_ object.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
These days, it is preferred to use ``tmp_path``.
|
||||||
|
|
||||||
|
:ref:`About the tmpdir and tmpdir_factory fixtures<tmpdir and tmpdir_factory>`.
|
||||||
|
|
||||||
.. _legacy_path: https://py.readthedocs.io/en/latest/path.html
|
.. _legacy_path: https://py.readthedocs.io/en/latest/path.html
|
||||||
|
|
||||||
caplog -- .../_pytest/logging.py:487
|
caplog -- .../_pytest/logging.py:487
|
||||||
|
@ -148,21 +207,26 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
monkeypatch -- .../_pytest/monkeypatch.py:29
|
monkeypatch -- .../_pytest/monkeypatch.py:29
|
||||||
A convenient fixture for monkey-patching.
|
A convenient fixture for monkey-patching.
|
||||||
|
|
||||||
The fixture provides these methods to modify objects, dictionaries or
|
The fixture provides these methods to modify objects, dictionaries, or
|
||||||
os.environ::
|
:data:`os.environ`:
|
||||||
|
|
||||||
monkeypatch.setattr(obj, name, value, raising=True)
|
* :meth:`monkeypatch.setattr(obj, name, value, raising=True) <pytest.MonkeyPatch.setattr>`
|
||||||
monkeypatch.delattr(obj, name, raising=True)
|
* :meth:`monkeypatch.delattr(obj, name, raising=True) <pytest.MonkeyPatch.delattr>`
|
||||||
monkeypatch.setitem(mapping, name, value)
|
* :meth:`monkeypatch.setitem(mapping, name, value) <pytest.MonkeyPatch.setitem>`
|
||||||
monkeypatch.delitem(obj, name, raising=True)
|
* :meth:`monkeypatch.delitem(obj, name, raising=True) <pytest.MonkeyPatch.delitem>`
|
||||||
monkeypatch.setenv(name, value, prepend=None)
|
* :meth:`monkeypatch.setenv(name, value, prepend=None) <pytest.MonkeyPatch.setenv>`
|
||||||
monkeypatch.delenv(name, raising=True)
|
* :meth:`monkeypatch.delenv(name, raising=True) <pytest.MonkeyPatch.delenv>`
|
||||||
monkeypatch.syspath_prepend(path)
|
* :meth:`monkeypatch.syspath_prepend(path) <pytest.MonkeyPatch.syspath_prepend>`
|
||||||
monkeypatch.chdir(path)
|
* :meth:`monkeypatch.chdir(path) <pytest.MonkeyPatch.chdir>`
|
||||||
|
* :meth:`monkeypatch.context() <pytest.MonkeyPatch.context>`
|
||||||
|
|
||||||
All modifications will be undone after the requesting test function or
|
All modifications will be undone after the requesting test function or
|
||||||
fixture has finished. The ``raising`` parameter determines if a KeyError
|
fixture has finished. The ``raising`` parameter determines if a :class:`KeyError`
|
||||||
or AttributeError will be raised if the set/deletion operation has no target.
|
or :class:`AttributeError` will be raised if the set/deletion operation does not have the
|
||||||
|
specified target.
|
||||||
|
|
||||||
|
To undo modifications done by the fixture in a contained scope,
|
||||||
|
use :meth:`context() <pytest.MonkeyPatch.context>`.
|
||||||
|
|
||||||
recwarn -- .../_pytest/recwarn.py:29
|
recwarn -- .../_pytest/recwarn.py:29
|
||||||
Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
|
Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
|
||||||
|
|
|
@ -28,6 +28,47 @@ with advance notice in the **Deprecations** section of releases.
|
||||||
|
|
||||||
.. towncrier release notes start
|
.. towncrier release notes start
|
||||||
|
|
||||||
|
pytest 7.1.3 (2022-08-31)
|
||||||
|
=========================
|
||||||
|
|
||||||
|
Bug Fixes
|
||||||
|
---------
|
||||||
|
|
||||||
|
- `#10060 <https://github.com/pytest-dev/pytest/issues/10060>`_: When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``.
|
||||||
|
|
||||||
|
|
||||||
|
- `#10190 <https://github.com/pytest-dev/pytest/issues/10190>`_: Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports.
|
||||||
|
|
||||||
|
|
||||||
|
- `#10230 <https://github.com/pytest-dev/pytest/issues/10230>`_: Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 <https://pip.pypa.io/en/stable/news/#v21-3>`__.
|
||||||
|
|
||||||
|
|
||||||
|
- `#3396 <https://github.com/pytest-dev/pytest/issues/3396>`_: Doctests now respect the ``--import-mode`` flag.
|
||||||
|
|
||||||
|
|
||||||
|
- `#9514 <https://github.com/pytest-dev/pytest/issues/9514>`_: Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed.
|
||||||
|
|
||||||
|
|
||||||
|
- `#9791 <https://github.com/pytest-dev/pytest/issues/9791>`_: Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems.
|
||||||
|
|
||||||
|
|
||||||
|
- `#9917 <https://github.com/pytest-dev/pytest/issues/9917>`_: Fixed string representation for :func:`pytest.approx` when used to compare tuples.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Improved Documentation
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
- `#9937 <https://github.com/pytest-dev/pytest/issues/9937>`_: Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Trivial/Internal Changes
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
- `#10114 <https://github.com/pytest-dev/pytest/issues/10114>`_: Replace `atomicwrites <https://github.com/untitaker/python-atomicwrites>`__ dependency on windows with `os.replace`.
|
||||||
|
|
||||||
|
|
||||||
pytest 7.1.2 (2022-04-23)
|
pytest 7.1.2 (2022-04-23)
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Install ``pytest``
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ pytest --version
|
$ pytest --version
|
||||||
pytest 7.1.2
|
pytest 7.1.3
|
||||||
|
|
||||||
.. _`simpletest`:
|
.. _`simpletest`:
|
||||||
|
|
||||||
|
|
|
@ -772,6 +772,7 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur
|
||||||
$ pytest -s test_finalizers.py
|
$ pytest -s test_finalizers.py
|
||||||
=========================== test session starts ============================
|
=========================== test session starts ============================
|
||||||
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
|
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
|
||||||
|
rootdir: /home/sweet/project
|
||||||
collected 1 item
|
collected 1 item
|
||||||
|
|
||||||
test_finalizers.py test_bar
|
test_finalizers.py test_bar
|
||||||
|
@ -779,6 +780,7 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur
|
||||||
after_yield_1
|
after_yield_1
|
||||||
|
|
||||||
|
|
||||||
|
============================ 1 passed in 0.12s =============================
|
||||||
|
|
||||||
For finalizers, the first fixture to run is last call to `request.addfinalizer`.
|
For finalizers, the first fixture to run is last call to `request.addfinalizer`.
|
||||||
|
|
||||||
|
@ -804,12 +806,16 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
|
||||||
$ pytest -s test_finalizers.py
|
$ pytest -s test_finalizers.py
|
||||||
=========================== test session starts ============================
|
=========================== test session starts ============================
|
||||||
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
|
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
|
||||||
|
rootdir: /home/sweet/project
|
||||||
collected 1 item
|
collected 1 item
|
||||||
|
|
||||||
test_finalizers.py test_bar
|
test_finalizers.py test_bar
|
||||||
.finalizer_1
|
.finalizer_1
|
||||||
finalizer_2
|
finalizer_2
|
||||||
|
|
||||||
|
|
||||||
|
============================ 1 passed in 0.12s =============================
|
||||||
|
|
||||||
This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code.
|
This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1411,7 +1417,7 @@ Running the above tests results in the following test IDs being used:
|
||||||
=========================== test session starts ============================
|
=========================== test session starts ============================
|
||||||
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
|
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
|
||||||
rootdir: /home/sweet/project
|
rootdir: /home/sweet/project
|
||||||
collected 11 items
|
collected 12 items
|
||||||
|
|
||||||
<Module test_anothersmtp.py>
|
<Module test_anothersmtp.py>
|
||||||
<Function test_showhelo[smtp.gmail.com]>
|
<Function test_showhelo[smtp.gmail.com]>
|
||||||
|
@ -1431,7 +1437,7 @@ Running the above tests results in the following test IDs being used:
|
||||||
<Function test_ehlo[mail.python.org]>
|
<Function test_ehlo[mail.python.org]>
|
||||||
<Function test_noop[mail.python.org]>
|
<Function test_noop[mail.python.org]>
|
||||||
|
|
||||||
======================= 11 tests collected in 0.12s ========================
|
======================= 12 tests collected in 0.12s ========================
|
||||||
|
|
||||||
.. _`fixture-parametrize-marks`:
|
.. _`fixture-parametrize-marks`:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue