From 3905a74b09ab4faded2a0aff7c4147fbb5b1a1e7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 10 Sep 2024 07:53:09 -0300 Subject: [PATCH] Merge pull request #12798 from pytest-dev/release-8.3.3 Prepare release 8.3.3 (cherry picked from commit 03d8fb79aa3731f8c46f582bde8d590dbb278aba) --- changelog/12446.bugfix.rst | 1 - changelog/12659.bugfix.rst | 1 - changelog/12663.doc.rst | 1 - changelog/12667.bugfix.rst | 1 - changelog/12678.doc.rst | 1 - changelog/12744.bugfix.rst | 1 - changelog/12745.bugfix.rst | 1 - changelog/12769.misc.rst | 1 - changelog/6682.bugfix.rst | 1 - changelog/9422.bugfix.rst | 3 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-8.3.3.rst | 31 +++++++++++++++++++ doc/en/builtin.rst | 18 +++++------ doc/en/changelog.rst | 46 +++++++++++++++++++++++++++++ doc/en/example/parametrize.rst | 6 ++-- doc/en/example/pythoncollection.rst | 4 +-- doc/en/getting-started.rst | 2 +- doc/en/how-to/fixtures.rst | 2 +- 18 files changed, 94 insertions(+), 28 deletions(-) delete mode 100644 changelog/12446.bugfix.rst delete mode 100644 changelog/12659.bugfix.rst delete mode 100644 changelog/12663.doc.rst delete mode 100644 changelog/12667.bugfix.rst delete mode 100644 changelog/12678.doc.rst delete mode 100644 changelog/12744.bugfix.rst delete mode 100644 changelog/12745.bugfix.rst delete mode 100644 changelog/12769.misc.rst delete mode 100644 changelog/6682.bugfix.rst delete mode 100644 changelog/9422.bugfix.rst create mode 100644 doc/en/announce/release-8.3.3.rst diff --git a/changelog/12446.bugfix.rst b/changelog/12446.bugfix.rst deleted file mode 100644 index 2f591c48eed..00000000000 --- a/changelog/12446.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Avoid calling ``@property`` (and other instance descriptors) during fixture discovery -- by :user:`asottile` diff --git a/changelog/12659.bugfix.rst b/changelog/12659.bugfix.rst deleted file mode 100644 index 297381b9602..00000000000 --- a/changelog/12659.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed the issue of not displaying assertion failure differences when using the parameter ``--import-mode=importlib`` in pytest>=8.1. diff --git a/changelog/12663.doc.rst b/changelog/12663.doc.rst deleted file mode 100644 index e665bc67a10..00000000000 --- a/changelog/12663.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Clarify that the `pytest_deselected` hook should be called from `pytest_collection_modifyitems` hook implementations when items are deselected. diff --git a/changelog/12667.bugfix.rst b/changelog/12667.bugfix.rst deleted file mode 100644 index eceee86cb53..00000000000 --- a/changelog/12667.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a regression where type change in `ExceptionInfo.errisinstance` caused `mypy` to fail. diff --git a/changelog/12678.doc.rst b/changelog/12678.doc.rst deleted file mode 100644 index 9d79ec41007..00000000000 --- a/changelog/12678.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Remove erroneous quotes from `tmp_path_retention_policy` example in docs. diff --git a/changelog/12744.bugfix.rst b/changelog/12744.bugfix.rst deleted file mode 100644 index 7814b59c180..00000000000 --- a/changelog/12744.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed typing compatibility with Python 3.9 or less -- replaced `typing.Self` with `typing_extensions.Self` -- by :user:`Avasam` diff --git a/changelog/12745.bugfix.rst b/changelog/12745.bugfix.rst deleted file mode 100644 index 420be931ce9..00000000000 --- a/changelog/12745.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue with backslashes being incorrectly converted in nodeid paths on Windows, ensuring consistent path handling across environments. diff --git a/changelog/12769.misc.rst b/changelog/12769.misc.rst deleted file mode 100644 index aae4d137a0d..00000000000 --- a/changelog/12769.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Fix typos discovered by codespell and add codespell to pre-commit hooks. diff --git a/changelog/6682.bugfix.rst b/changelog/6682.bugfix.rst deleted file mode 100644 index 7f756cbd9c2..00000000000 --- a/changelog/6682.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed bug where the verbosity levels where not being respected when printing the "msg" part of failed assertion (as in ``assert condition, msg``). diff --git a/changelog/9422.bugfix.rst b/changelog/9422.bugfix.rst deleted file mode 100644 index 38196340fd5..00000000000 --- a/changelog/9422.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix bug where disabling the terminal plugin via ``-p no:terminal`` would cause crashes related to missing the ``verbose`` option. - --- by :user:`GTowers1` diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 09311a1a1ab..61e4a772beb 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-8.3.3 release-8.3.2 release-8.3.1 release-8.3.0 diff --git a/doc/en/announce/release-8.3.3.rst b/doc/en/announce/release-8.3.3.rst new file mode 100644 index 00000000000..5e3eb36b921 --- /dev/null +++ b/doc/en/announce/release-8.3.3.rst @@ -0,0 +1,31 @@ +pytest-8.3.3 +======================================= + +pytest 8.3.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 +* Avasam +* Bruno Oliveira +* Christian Clauss +* Eugene Mwangi +* Florian Bruhin +* GTowers1 +* Nauman Ahmed +* Pierre Sassoulas +* Reagan Lee +* Ronny Pfannschmidt +* Stefaan Lippens +* Sviatoslav Sydorenko (Святослав Сидоренко) +* dongfangtianyu + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index b4c0f91f8e5..9b406a6a512 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -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:558 + cache -- .../_pytest/cacheprovider.py:556 Return a cache object that can persist state between testing sessions. cache.get(key, default) @@ -33,7 +33,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Values can be any object handled by the json stdlib module. - capsysbinary -- .../_pytest/capture.py:1005 + capsysbinary -- .../_pytest/capture.py:1006 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` @@ -51,7 +51,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsysbinary.readouterr() assert captured.out == b"hello\n" - capfd -- .../_pytest/capture.py:1033 + capfd -- .../_pytest/capture.py:1034 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -69,7 +69,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfd.readouterr() assert captured.out == "hello\n" - capfdbinary -- .../_pytest/capture.py:1061 + capfdbinary -- .../_pytest/capture.py:1062 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -87,7 +87,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfdbinary.readouterr() assert captured.out == b"hello\n" - capsys -- .../_pytest/capture.py:977 + capsys -- .../_pytest/capture.py:978 Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsys.readouterr()`` method @@ -105,7 +105,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsys.readouterr() assert captured.out == "hello\n" - doctest_namespace [session scope] -- .../_pytest/doctest.py:740 + doctest_namespace [session scope] -- .../_pytest/doctest.py:741 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. @@ -119,14 +119,14 @@ 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:1344 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1345 Session-scoped fixture that returns the session's :class:`pytest.Config` object. Example:: def test_foo(pytestconfig): - if pytestconfig.getoption("verbose") > 0: + if pytestconfig.get_verbosity() > 0: ... record_property -- .../_pytest/junitxml.py:280 @@ -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:600 + caplog -- .../_pytest/logging.py:598 Access and control log capturing. Captured logs are available through the following properties/methods:: diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 9da6f487f8d..9f30c86be3a 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -31,6 +31,52 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 8.3.3 (2024-09-09) +========================= + +Bug fixes +--------- + +- `#12446 `_: Avoid calling ``@property`` (and other instance descriptors) during fixture discovery -- by :user:`asottile` + + +- `#12659 `_: Fixed the issue of not displaying assertion failure differences when using the parameter ``--import-mode=importlib`` in pytest>=8.1. + + +- `#12667 `_: Fixed a regression where type change in `ExceptionInfo.errisinstance` caused `mypy` to fail. + + +- `#12744 `_: Fixed typing compatibility with Python 3.9 or less -- replaced `typing.Self` with `typing_extensions.Self` -- by :user:`Avasam` + + +- `#12745 `_: Fixed an issue with backslashes being incorrectly converted in nodeid paths on Windows, ensuring consistent path handling across environments. + + +- `#6682 `_: Fixed bug where the verbosity levels where not being respected when printing the "msg" part of failed assertion (as in ``assert condition, msg``). + + +- `#9422 `_: Fix bug where disabling the terminal plugin via ``-p no:terminal`` would cause crashes related to missing the ``verbose`` option. + + -- by :user:`GTowers1` + + + +Improved documentation +---------------------- + +- `#12663 `_: Clarify that the `pytest_deselected` hook should be called from `pytest_collection_modifyitems` hook implementations when items are deselected. + + +- `#12678 `_: Remove erroneous quotes from `tmp_path_retention_policy` example in docs. + + + +Miscellaneous internal changes +------------------------------ + +- `#12769 `_: Fix typos discovered by codespell and add codespell to pre-commit hooks. + + pytest 8.3.2 (2024-07-24) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index b175510da6a..fa43308d045 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -162,7 +162,7 @@ objects, they are still using the default pytest representation: rootdir: /home/sweet/project collected 8 items - + @@ -239,7 +239,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia rootdir: /home/sweet/project collected 4 items - + @@ -318,7 +318,7 @@ Let's first see how it looks like at collection time: rootdir: /home/sweet/project collected 2 items - + diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 5bd03035c14..42a603f114c 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -152,7 +152,7 @@ The test collection would look like this: configfile: pytest.ini collected 2 items - + @@ -215,7 +215,7 @@ You can always peek at the collection tree without running tests like this: configfile: pytest.ini collected 3 items - + diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 050fd2d80ec..faf81154c48 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 8.3.2 + pytest 8.3.3 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index d60635c4fea..4f6e8cbee06 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1418,7 +1418,7 @@ Running the above tests results in the following test IDs being used: rootdir: /home/sweet/project collected 12 items - +