From 8c25a140322d81ee6d2129556ee6e670e588be73 Mon Sep 17 00:00:00 2001 From: Eric Liu <54130092+ericluoliu@users.noreply.github.com> Date: Sat, 3 Jul 2021 03:20:12 -0700 Subject: [PATCH] closes #8824 Changelog rewording for 7.0 (#8826) * fixed changelog/*.rst docs * add author name * fixed-documents * fix issue 8761 doc * fix issue 8645 doc * fix issue 8447 doc * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- AUTHORS | 1 + changelog/7469.deprecation.rst | 2 +- changelog/7469.feature.rst | 2 +- changelog/8242.deprecation.rst | 2 +- changelog/8248.trivial.rst | 2 +- changelog/8315.deprecation.rst | 2 +- changelog/8411.trivial.rst | 1 - changelog/8447.deprecation.rst | 2 +- changelog/{8503.trivial.rst => 8503.bugfix.rst} | 0 changelog/8509.improvement.rst | 4 ++-- changelog/8606.feature.rst | 2 +- changelog/8645.deprecation.rst | 4 ++++ changelog/8645.improvement.rst | 4 ---- 13 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 changelog/8411.trivial.rst rename changelog/{8503.trivial.rst => 8503.bugfix.rst} (100%) create mode 100644 changelog/8645.deprecation.rst delete mode 100644 changelog/8645.improvement.rst diff --git a/AUTHORS b/AUTHORS index f979fee06..5c3610e69 100644 --- a/AUTHORS +++ b/AUTHORS @@ -107,6 +107,7 @@ Eli Boyarski Elizaveta Shashkova Endre Galaczi Eric Hunsberger +Eric Liu Eric Siegerman Erik Aronesty Erik M. Bray diff --git a/changelog/7469.deprecation.rst b/changelog/7469.deprecation.rst index 3762306c7..423b1633b 100644 --- a/changelog/7469.deprecation.rst +++ b/changelog/7469.deprecation.rst @@ -9,4 +9,4 @@ Directly constructing the following classes is now deprecated: - ``_pytest.config.argparsing.Parser`` - ``_pytest.config.argparsing.OptionGroup`` -These have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 7.0.0. +These have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8.0.0. diff --git a/changelog/7469.feature.rst b/changelog/7469.feature.rst index 9922631fe..301317087 100644 --- a/changelog/7469.feature.rst +++ b/changelog/7469.feature.rst @@ -14,6 +14,6 @@ The newly-exported types are: - ``pytest.OptionGroup`` for the :class:`OptionGroup ` type returned from the :func:`parser.addgroup ` method. Constructing them directly is not supported; they are only meant for use in type annotations. -Doing so will emit a deprecation warning, and may become a hard-error in pytest 7.0. +Doing so will emit a deprecation warning, and may become a hard-error in pytest 8.0. Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy. diff --git a/changelog/8242.deprecation.rst b/changelog/8242.deprecation.rst index b2e8566ea..3875c5867 100644 --- a/changelog/8242.deprecation.rst +++ b/changelog/8242.deprecation.rst @@ -1,7 +1,7 @@ Raising :class:`unittest.SkipTest` to skip collection of tests during the pytest collection phase is deprecated. Use :func:`pytest.skip` instead. -Note: This deprecation only relates to using `unittest.SkipTest` during test +Note: This deprecation only relates to using :class:`unittest.SkipTest` during test collection. You are probably not doing that. Ordinary usage of :class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` / :func:`unittest.skip` in unittest test cases is fully supported. diff --git a/changelog/8248.trivial.rst b/changelog/8248.trivial.rst index 0a9319d9c..3044071fa 100644 --- a/changelog/8248.trivial.rst +++ b/changelog/8248.trivial.rst @@ -1 +1 @@ -Internal Restructure: let python.PyObjMixing inherit from nodes.Node to carry over typing information. +Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. diff --git a/changelog/8315.deprecation.rst b/changelog/8315.deprecation.rst index c30dcf5d1..b204dcedd 100644 --- a/changelog/8315.deprecation.rst +++ b/changelog/8315.deprecation.rst @@ -1,5 +1,5 @@ Several behaviors of :meth:`Parser.addoption ` are now -scheduled for removal in pytest 7 (deprecated since pytest 2.4.0): +scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): - ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead. - ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead. diff --git a/changelog/8411.trivial.rst b/changelog/8411.trivial.rst deleted file mode 100644 index 8f169a900..000000000 --- a/changelog/8411.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Assert the outcomes for the issue 518 test and fix the test. diff --git a/changelog/8447.deprecation.rst b/changelog/8447.deprecation.rst index d1011f8c8..0116483a3 100644 --- a/changelog/8447.deprecation.rst +++ b/changelog/8447.deprecation.rst @@ -1,4 +1,4 @@ -Defining a custom pytest node type which is both an item and a collector now issues a warning. +Defining a custom pytest node type which is both an :class:`pytest.Item ` and a :class:`pytest.Collector ` now issues a warning. It was never sanely supported and triggers hard to debug errors. Instead, a separate collector node should be used, which collects the item. See :ref:`non-python tests` for an example. diff --git a/changelog/8503.trivial.rst b/changelog/8503.bugfix.rst similarity index 100% rename from changelog/8503.trivial.rst rename to changelog/8503.bugfix.rst diff --git a/changelog/8509.improvement.rst b/changelog/8509.improvement.rst index d72e8e487..982888c1f 100644 --- a/changelog/8509.improvement.rst +++ b/changelog/8509.improvement.rst @@ -1,5 +1,5 @@ -Fixed issue where `TestCase.setUpClass` is not called when a test has `/` in its name since pytest 6.2.0. +Fixed issue where :meth:`unittest.TestCase.setUpClass` is not called when a test has `/` in its name since pytest 6.2.0. -This refers to the path part in pytest node IDs, e.g. `TestClass::test_it` in the node ID `tests/test_file.py::TestClass::test_it`. +This refers to the path part in pytest node IDs, e.g. ``TestClass::test_it`` in the node ID ``tests/test_file.py::TestClass::test_it``. Now, instead of assuming that the test name does not contain ``/``, it is assumed that test path does not contain ``::``. We plan to hopefully make both of these work in the future. diff --git a/changelog/8606.feature.rst b/changelog/8606.feature.rst index 9705ffe75..d918ecd1e 100644 --- a/changelog/8606.feature.rst +++ b/changelog/8606.feature.rst @@ -1,4 +1,4 @@ -pytest invocations with ``--fixtures-per-test`` and ``--fixtures`` have been enabled with: +pytest invocations with ``--fixtures-per-test`` and ``--fixtures`` have been enriched with: - Fixture location path printed with the fixture name. - First section of the fixture's docstring printed under the fixture name. diff --git a/changelog/8645.deprecation.rst b/changelog/8645.deprecation.rst new file mode 100644 index 000000000..722a5d764 --- /dev/null +++ b/changelog/8645.deprecation.rst @@ -0,0 +1,4 @@ +:func:`pytest.warns(None) ` is now deprecated because many people used +it to mean "this code does not emit warnings", but it actually had the effect of +checking that the code emits at least one warning of any type - like ``pytest.warns()`` +or ``pytest.warns(Warning)``. diff --git a/changelog/8645.improvement.rst b/changelog/8645.improvement.rst deleted file mode 100644 index b3a68b0b8..000000000 --- a/changelog/8645.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -Reducing confusion from `pytest.warns(None)` by: - -- Allowing no arguments to be passed in order to catch any exception (no argument defaults to `Warning`). -- Emit a deprecation warning if passed `None`.