From 97a2761d72d881f6b0d313428835cf161b608d69 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 3 Mar 2023 12:25:33 -0300 Subject: [PATCH 1/3] Fix test_cmdline_python_namespace_package (#10788) pgk_resources.declare_namespace has been deprecated, so added an ignore warnings option to the test. --- testing/acceptance_test.py | 9 ++++++++- testing/test_monkeypatch.py | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 62acf1209..6b421dde6 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -693,7 +693,14 @@ class TestInvocationVariants: # mixed module and filenames: monkeypatch.chdir("world") - result = pytester.runpytest("--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world") + + # pgk_resources.declare_namespace has been deprecated in favor of implicit namespace packages. + # While we could change the test to use implicit namespace packages, seems better + # to still ensure the old declaration via declare_namespace still works. + ignore_w = r"-Wignore:Deprecated call to `pkg_resources.declare_namespace" + result = pytester.runpytest( + "--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world", ignore_w + ) assert result.ret == 0 result.stdout.fnmatch_lines( [ diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index b32e67bd7..3d09ef426 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -425,6 +425,9 @@ def test_context_classmethod() -> None: assert A.x == 1 +@pytest.mark.filterwarnings( + "ignore:Deprecated call to `pkg_resources.declare_namespace" +) def test_syspath_prepend_with_namespace_packages( pytester: Pytester, monkeypatch: MonkeyPatch ) -> None: From 4e259590c99b75c32ab2b498b0f75cd18ee24629 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 3 Mar 2023 12:53:38 -0300 Subject: [PATCH 2/3] Normalize how changelog entries are written (#10779) Went over all changelog entries making sure they follow our guidelines as written at: https://github.com/pytest-dev/pytest/blob/88c9e92258a15697c4f125ea1b930856ebe2975f/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L18-L21 --- changelog/10533.bugfix.rst | 2 +- changelog/10597.bugfix.rst | 2 +- changelog/10626.bugfix.rst | 2 +- changelog/10660.bugfix.rst | 2 +- changelog/10753.doc.rst | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/changelog/10533.bugfix.rst b/changelog/10533.bugfix.rst index c49e4c3aa..c7e49189d 100644 --- a/changelog/10533.bugfix.rst +++ b/changelog/10533.bugfix.rst @@ -1 +1 @@ -Fix :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0` in class ApproxMapping. +Fixed :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`. diff --git a/changelog/10597.bugfix.rst b/changelog/10597.bugfix.rst index 9070e74a3..793d35b36 100644 --- a/changelog/10597.bugfix.rst +++ b/changelog/10597.bugfix.rst @@ -1 +1 @@ -Fix bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. +Fixed bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. diff --git a/changelog/10626.bugfix.rst b/changelog/10626.bugfix.rst index c3c7ef778..4032f69e0 100644 --- a/changelog/10626.bugfix.rst +++ b/changelog/10626.bugfix.rst @@ -1 +1 @@ -Fix crash if ``--fixtures`` and ``--help`` are passed at the same time. +Fixed crash if ``--fixtures`` and ``--help`` are passed at the same time. diff --git a/changelog/10660.bugfix.rst b/changelog/10660.bugfix.rst index 62e354941..84a913fe9 100644 --- a/changelog/10660.bugfix.rst +++ b/changelog/10660.bugfix.rst @@ -1,2 +1,2 @@ -Fix :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow +Fixed :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow :code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. diff --git a/changelog/10753.doc.rst b/changelog/10753.doc.rst index 701d81a7c..13b021ea7 100644 --- a/changelog/10753.doc.rst +++ b/changelog/10753.doc.rst @@ -1,2 +1,2 @@ -Change wording of the module level skip to be very explicit -about not collecting and not executing the rest of the module. +Changed wording of the module level skip to be very explicit +about not collecting tests and not executing the rest of the module. From 517e02e59e2960c8688dbbcd000cf231b7531348 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 3 Mar 2023 16:13:19 -0300 Subject: [PATCH 3/3] Merge pull request #10792 from pytest-dev/release-7.2.2 Prepare release 7.2.2 (cherry picked from commit 3ce6030f0cc0e6fb18cbee1a4a8b1cec8c6d0b0c) --- changelog/10533.bugfix.rst | 1 - changelog/10592.bugfix.rst | 1 - changelog/10597.bugfix.rst | 1 - changelog/10626.bugfix.rst | 1 - changelog/10660.bugfix.rst | 2 -- changelog/10690.doc.rst | 1 - changelog/10721.doc.rst | 1 - changelog/10753.doc.rst | 2 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-7.2.2.rst | 25 +++++++++++++++++++++ doc/en/builtin.rst | 2 +- doc/en/changelog.rst | 36 +++++++++++++++++++++++++++++++ doc/en/getting-started.rst | 2 +- 13 files changed, 64 insertions(+), 12 deletions(-) delete mode 100644 changelog/10533.bugfix.rst delete mode 100644 changelog/10592.bugfix.rst delete mode 100644 changelog/10597.bugfix.rst delete mode 100644 changelog/10626.bugfix.rst delete mode 100644 changelog/10660.bugfix.rst delete mode 100644 changelog/10690.doc.rst delete mode 100644 changelog/10721.doc.rst delete mode 100644 changelog/10753.doc.rst create mode 100644 doc/en/announce/release-7.2.2.rst diff --git a/changelog/10533.bugfix.rst b/changelog/10533.bugfix.rst deleted file mode 100644 index c7e49189d..000000000 --- a/changelog/10533.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`. diff --git a/changelog/10592.bugfix.rst b/changelog/10592.bugfix.rst deleted file mode 100644 index 62c1c7e3c..000000000 --- a/changelog/10592.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed crash if `--cache-show` and `--help` are passed at the same time. diff --git a/changelog/10597.bugfix.rst b/changelog/10597.bugfix.rst deleted file mode 100644 index 793d35b36..000000000 --- a/changelog/10597.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. diff --git a/changelog/10626.bugfix.rst b/changelog/10626.bugfix.rst deleted file mode 100644 index 4032f69e0..000000000 --- a/changelog/10626.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed crash if ``--fixtures`` and ``--help`` are passed at the same time. diff --git a/changelog/10660.bugfix.rst b/changelog/10660.bugfix.rst deleted file mode 100644 index 84a913fe9..000000000 --- a/changelog/10660.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow -:code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. diff --git a/changelog/10690.doc.rst b/changelog/10690.doc.rst deleted file mode 100644 index faf61b3cc..000000000 --- a/changelog/10690.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added `CI` and `BUILD_NUMBER` environment variables to the documentation. diff --git a/changelog/10721.doc.rst b/changelog/10721.doc.rst deleted file mode 100644 index 33ba40512..000000000 --- a/changelog/10721.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed entry-points declaration in the documentation example using Hatch. diff --git a/changelog/10753.doc.rst b/changelog/10753.doc.rst deleted file mode 100644 index 13b021ea7..000000000 --- a/changelog/10753.doc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Changed wording of the module level skip to be very explicit -about not collecting tests and not executing the rest of the module. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 4df322882..fa57ca5c8 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.2.2 release-7.2.1 release-7.2.0 release-7.1.3 diff --git a/doc/en/announce/release-7.2.2.rst b/doc/en/announce/release-7.2.2.rst new file mode 100644 index 000000000..b34a6ff5c --- /dev/null +++ b/doc/en/announce/release-7.2.2.rst @@ -0,0 +1,25 @@ +pytest-7.2.2 +======================================= + +pytest 7.2.2 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: + +* Bruno Oliveira +* Garvit Shubham +* Mahesh Vashishtha +* Ramsey +* Ronny Pfannschmidt +* Teejay +* q0w +* vin01 + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 4b6d8d844..453be4ad3 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:510 + cache -- .../_pytest/cacheprovider.py:509 Return a cache object that can persist state between testing sessions. cache.get(key, default) diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 988e083d0..020e6289e 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,42 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.2.2 (2023-03-03) +========================= + +Bug Fixes +--------- + +- `#10533 `_: Fixed :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`. + + +- `#10592 `_: Fixed crash if `--cache-show` and `--help` are passed at the same time. + + +- `#10597 `_: Fixed bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. + + +- `#10626 `_: Fixed crash if ``--fixtures`` and ``--help`` are passed at the same time. + + +- `#10660 `_: Fixed :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow + :code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. + + + +Improved Documentation +---------------------- + +- `#10690 `_: Added `CI` and `BUILD_NUMBER` environment variables to the documentation. + + +- `#10721 `_: Fixed entry-points declaration in the documentation example using Hatch. + + +- `#10753 `_: Changed wording of the module level skip to be very explicit + about not collecting tests and not executing the rest of the module. + + pytest 7.2.1 (2023-01-13) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index e109839bf..b36c2e3cc 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 7.2.1 + pytest 7.2.2 .. _`simpletest`: