Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release 7.4.0 #11131

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion changelog/10831.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/10872.improvement.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/10901.feature.rst

This file was deleted.

5 changes: 0 additions & 5 deletions changelog/10907.improvement.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/10940.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/10991.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11005.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11013.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11031.trivial.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/11043.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11068.bugfix.rst

This file was deleted.

7 changes: 0 additions & 7 deletions changelog/11081.improvement.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/11104.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/1904.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/7781.bugfix.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/8711.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/9146.doc.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-7.4.0
release-7.3.2
release-7.3.1
release-7.3.0
49 changes: 49 additions & 0 deletions doc/en/announce/release-7.4.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
pytest-7.4.0
=======================================

The pytest team is proud to announce the 7.4.0 release!

This release contains new features, improvements, and bug fixes,
the full list of changes is available in the changelog:

https://docs.pytest.org/en/stable/changelog.html

For complete documentation, please visit:

https://docs.pytest.org/en/stable/

As usual, you can upgrade from PyPI via:

pip install -U pytest

Thanks to all of the contributors to this release:

* Adam J. Stewart
* Alessio Izzo
* Alex
* Alex Lambson
* Brian Larsen
* Bruno Oliveira
* Bryan Ricker
* Chris Mahoney
* Facundo Batista
* Florian Bruhin
* Jarrett Keifer
* Kenny Y
* Miro Hrončok
* Ran Benita
* Roberto Aldera
* Ronny Pfannschmidt
* Sergey Kim
* Stefanie Molin
* Vijay Arora
* Ville Skyttä
* Zac Hatfield-Dodds
* bzoracler
* leeyueh
* nondescryptid
* theirix


Happy testing,
The pytest Development Team
6 changes: 3 additions & 3 deletions doc/en/builtin.rst
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
cachedir: .pytest_cache
rootdir: /home/sweet/project
collected 0 items
cache -- .../_pytest/cacheprovider.py:510
cache -- .../_pytest/cacheprovider.py:528
Return a cache object that can persist state between testing sessions.

cache.get(key, default)
@@ -119,7 +119,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a

For more details: :ref:`doctest_namespace`.

pytestconfig [session scope] -- .../_pytest/fixtures.py:1360
pytestconfig [session scope] -- .../_pytest/fixtures.py:1353
Session-scoped fixture that returns the session's :class:`pytest.Config`
object.

@@ -196,7 +196,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a

.. _legacy_path: https://py.readthedocs.io/en/latest/path.html

caplog -- .../_pytest/logging.py:498
caplog -- .../_pytest/logging.py:570
Access and control log capturing.

Captured logs are available through the following properties/methods::
92 changes: 92 additions & 0 deletions doc/en/changelog.rst
Original file line number Diff line number Diff line change
@@ -28,6 +28,98 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 7.4.0 (2023-06-23)
=========================

Features
--------

- `#10901 <https://github.com/pytest-dev/pytest/issues/10901>`_: Added :func:`ExceptionInfo.from_exception() <pytest.ExceptionInfo.from_exception>`, a simpler way to create an :class:`~pytest.ExceptionInfo` from an exception.
This can replace :func:`ExceptionInfo.from_exc_info() <pytest.ExceptionInfo.from_exc_info()>` for most uses.



Improvements
------------

- `#10872 <https://github.com/pytest-dev/pytest/issues/10872>`_: Update test log report annotation to named tuple and fixed inconsistency in docs for :hook:`pytest_report_teststatus` hook.


- `#10907 <https://github.com/pytest-dev/pytest/issues/10907>`_: When an exception traceback to be displayed is completely filtered out (by mechanisms such as ``__tracebackhide__``, internal frames, and similar), now only the exception string and the following message are shown:

"All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.".

Previously, the last frame of the traceback was shown, even though it was hidden.


- `#10940 <https://github.com/pytest-dev/pytest/issues/10940>`_: Improved verbose output (``-vv``) of ``skip`` and ``xfail`` reasons by performing text wrapping while leaving a clear margin for progress output.

Added ``TerminalReporter.wrap_write()`` as a helper for that.


- `#10991 <https://github.com/pytest-dev/pytest/issues/10991>`_: Added handling of ``%f`` directive to print microseconds in log format options, such as ``log-date-format``.


- `#11005 <https://github.com/pytest-dev/pytest/issues/11005>`_: Added the underlying exception to the cache provider's path creation and write warning messages.


- `#11013 <https://github.com/pytest-dev/pytest/issues/11013>`_: Added warning when :confval:`testpaths` is set, but paths are not found by glob. In this case, pytest will fall back to searching from the current directory.


- `#11043 <https://github.com/pytest-dev/pytest/issues/11043>`_: When `--confcutdir` is not specified, and there is no config file present, the conftest cutoff directory (`--confcutdir`) is now set to the :ref:`rootdir <rootdir>`.
Previously in such cases, `conftest.py` files would be probed all the way to the root directory of the filesystem.
If you are badly affected by this change, consider adding an empty config file to your desired cutoff directory, or explicitly set `--confcutdir`.


- `#11081 <https://github.com/pytest-dev/pytest/issues/11081>`_: The :confval:`norecursedirs` check is now performed in a :hook:`pytest_ignore_collect` implementation, so plugins can affect it.

If after updating to this version you see that your `norecursedirs` setting is not being respected,
it means that a conftest or a plugin you use has a bad `pytest_ignore_collect` implementation.
Most likely, your hook returns `False` for paths it does not want to ignore,
which ends the processing and doesn't allow other plugins, including pytest itself, to ignore the path.
The fix is to return `None` instead of `False` for paths your hook doesn't want to ignore.


- `#8711 <https://github.com/pytest-dev/pytest/issues/8711>`_: :func:`caplog.set_level() <pytest.LogCaptureFixture.set_level>` and :func:`caplog.at_level() <pytest.LogCaptureFixture.at_level>`
will temporarily enable the requested ``level`` if ``level`` was disabled globally via
``logging.disable(LEVEL)``.



Bug Fixes
---------

- `#10831 <https://github.com/pytest-dev/pytest/issues/10831>`_: Terminal Reporting: Fixed bug when running in ``--tb=line`` mode where ``pytest.fail(pytrace=False)`` tests report ``None``.


- `#11068 <https://github.com/pytest-dev/pytest/issues/11068>`_: Fixed the ``--last-failed`` whole-file skipping functionality ("skipped N files") for :ref:`non-python test files <non-python tests>`.


- `#11104 <https://github.com/pytest-dev/pytest/issues/11104>`_: Fixed a regression in pytest 7.3.2 which caused to :confval:`testpaths` to be considered for loading initial conftests,
even when it was not utilized (e.g. when explicit paths were given on the command line).
Now the ``testpaths`` are only considered when they are in use.


- `#1904 <https://github.com/pytest-dev/pytest/issues/1904>`_: Fixed traceback entries hidden with ``__tracebackhide__ = True`` still being shown for chained exceptions (parts after "... the above exception ..." message).


- `#7781 <https://github.com/pytest-dev/pytest/issues/7781>`_: Fix writing non-encodable text to log file when using ``--debug``.



Improved Documentation
----------------------

- `#9146 <https://github.com/pytest-dev/pytest/issues/9146>`_: Improved documentation for :func:`caplog.set_level() <pytest.LogCaptureFixture.set_level>`.



Trivial/Internal Changes
------------------------

- `#11031 <https://github.com/pytest-dev/pytest/issues/11031>`_: Enhanced the CLI flag for ``-c`` to now include ``--config-file`` to make it clear that this flag applies to the usage of a custom config file.


pytest 7.3.2 (2023-06-10)
=========================

2 changes: 1 addition & 1 deletion doc/en/getting-started.rst
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ Install ``pytest``
.. code-block:: bash

$ pytest --version
pytest 7.3.2
pytest 7.4.0

.. _`simpletest`:

4 changes: 2 additions & 2 deletions doc/en/reference/reference.rst
Original file line number Diff line number Diff line change
@@ -1923,9 +1923,9 @@ All the command-line flags can be obtained by running ``pytest --help``::
--strict-markers Markers not registered in the `markers` section of
the configuration file raise errors
--strict (Deprecated) alias to --strict-markers
-c, --config-file FILE
-c FILE, --config-file=FILE
Load configuration from `FILE` instead of trying to
locate one of the implicit configuration files
locate one of the implicit configuration files.
--continue-on-collection-errors
Force test execution even if collection errors occur
--rootdir=ROOTDIR Define root directory for tests. Can be relative